LOLMatchAnaysis¶

Name(s): Sean Perry

Website Link: https://sean1572.github.io/LOLMatchAnaysis/

Question¶

What game objectives in league of legends are more likely to be taken by winning teams?

Old Brainstroming¶

As a old player of the game, patches were intended to fix bugs and balance the game to reduce/reward playstyle. Sometimes it helps to reduce the power of a too powerful meta, or enforce a new meta in the game. So with this dataset in mine, an exceelent starting question would be "how did the patch notes change the meta"?

A few ways to define change the meta:

  • What champions are most likely to be ban
  • How do champion winrates change between patches
  • What game mechanics (towers/team deaths/dragons) were priotized and got more in games
  • Which roles carried

Here are some other questions that maybe be interesting along the same lines

  • Do diffrents leagues have diffrent playstyles/metas (define playstyles simliar to meta)

Another interesting thing we can pull from data is how can we determine what the winning meta was in a given season:

  • What did teams do to be more likely to win?
  • Do number of elite monsters kill indicate a victory? Where winning teams more likely to have killed baron/dragon?

Getting Set Up With the Dataset¶

In [1]:
import pandas as pd
import numpy as np
import os

import plotly.express as px
pd.options.plotting.backend = 'plotly'
In [2]:
lol = pd.read_csv("2022_LoL_esports_match_data_from_OraclesElixir.csv")
C:\Users\Siloux\.conda\envs\dsc80\lib\site-packages\IPython\core\interactiveshell.py:3442: DtypeWarning: Columns (2) have mixed types.Specify dtype option on import or set low_memory=False.
  exec(code_obj, self.user_global_ns, self.user_ns)
In [3]:
lol.shape
Out[3]:
(149232, 123)
In [4]:
lol.columns.values
Out[4]:
array(['gameid', 'datacompleteness', 'url', 'league', 'year', 'split',
       'playoffs', 'date', 'game', 'patch', 'participantid', 'side',
       'position', 'playername', 'playerid', 'teamname', 'teamid',
       'champion', 'ban1', 'ban2', 'ban3', 'ban4', 'ban5', 'gamelength',
       'result', 'kills', 'deaths', 'assists', 'teamkills', 'teamdeaths',
       'doublekills', 'triplekills', 'quadrakills', 'pentakills',
       'firstblood', 'firstbloodkill', 'firstbloodassist',
       'firstbloodvictim', 'team kpm', 'ckpm', 'firstdragon', 'dragons',
       'opp_dragons', 'elementaldrakes', 'opp_elementaldrakes',
       'infernals', 'mountains', 'clouds', 'oceans', 'chemtechs',
       'hextechs', 'dragons (type unknown)', 'elders', 'opp_elders',
       'firstherald', 'heralds', 'opp_heralds', 'firstbaron', 'barons',
       'opp_barons', 'firsttower', 'towers', 'opp_towers',
       'firstmidtower', 'firsttothreetowers', 'turretplates',
       'opp_turretplates', 'inhibitors', 'opp_inhibitors',
       'damagetochampions', 'dpm', 'damageshare', 'damagetakenperminute',
       'damagemitigatedperminute', 'wardsplaced', 'wpm', 'wardskilled',
       'wcpm', 'controlwardsbought', 'visionscore', 'vspm', 'totalgold',
       'earnedgold', 'earned gpm', 'earnedgoldshare', 'goldspent', 'gspd',
       'total cs', 'minionkills', 'monsterkills', 'monsterkillsownjungle',
       'monsterkillsenemyjungle', 'cspm', 'goldat10', 'xpat10', 'csat10',
       'opp_goldat10', 'opp_xpat10', 'opp_csat10', 'golddiffat10',
       'xpdiffat10', 'csdiffat10', 'killsat10', 'assistsat10',
       'deathsat10', 'opp_killsat10', 'opp_assistsat10', 'opp_deathsat10',
       'goldat15', 'xpat15', 'csat15', 'opp_goldat15', 'opp_xpat15',
       'opp_csat15', 'golddiffat15', 'xpdiffat15', 'csdiffat15',
       'killsat15', 'assistsat15', 'deathsat15', 'opp_killsat15',
       'opp_assistsat15', 'opp_deathsat15'], dtype=object)
In [5]:
#Frist thing frist, lets try to spilt team data and player data
#Perhaps playername/playerid is a good place to start
lol["playername"].value_counts()
Out[5]:
unknown player    2304
Wei                162
Ming               156
GALA               156
Xiaohu             156
                  ... 
Scott                1
GeTSloW              1
Michlit              1
Mutra                1
Kokas                1
Name: playername, Length: 3809, dtype: int64
In [6]:
lol["playerid"].value_counts()
Out[6]:
oe:player:b61e517b1a6027160aafaf56e9867c0    162
oe:player:4e09acc2529add19ff0686b1341e3d0    156
oe:player:867e8957fae1cb59f0808dbcc3aada2    156
oe:player:beea9fe15bff6a7ab0b3913d3d5fde6    156
oe:player:f8b68f268106124fc4bc1c946adc9b0    144
                                            ... 
oe:player:d5f29d02c379345704b96e9ccf2c715      1
oe:player:516a215b20afebf330f13c99c7e78ec      1
oe:player:9c7e382c090ab2e9658c35ac407e552      1
oe:player:372a540578dcf91771f089ce1038e71      1
oe:player:a2e57e7b1518e1564cc96ee88e7f80d      1
Name: playerid, Length: 3858, dtype: int64
In [7]:
lol["playerid"].isnull().sum(), lol["playername"].isnull().sum()
Out[7]:
(27179, 24872)

Idea: Lets figure out how many unique games there were and then try to use that information to figure what rows are team matches vs player matches

In [8]:
lol["gameid"].unique().shape, lol["gameid"].isnull().sum()
Out[8]:
((12436,), 0)

So 12436 games, with no game with any null values, if there are 12436 games and 2 teams per game, then there should be a total of 12436 * 2 team rows if there is a row for each 2 teams in each game.

In [9]:
(
    lol["gameid"].unique().shape[0] * 2, 
    lol["playerid"].isnull().sum(), 
    lol["playername"].isnull().sum()
)
Out[9]:
(24872, 27179, 24872)

And we have a match for number of games times 2 and number of teams for each game. So if playername is null, the row is a game summary

In [10]:
lol_team_data = lol[lol["playername"].isnull()].reset_index(drop=True)
lol_team_data
Out[10]:
gameid datacompleteness url league year split playoffs date game patch ... opp_csat15 golddiffat15 xpdiffat15 csdiffat15 killsat15 assistsat15 deathsat15 opp_killsat15 opp_assistsat15 opp_deathsat15
0 ESPORTSTMNT01_2690210 complete NaN LCK CL 2022 Spring 0 2022-01-10 07:44:08 1 12.01 ... 510.0 107.0 -1617.0 -23.0 5.0 10.0 6.0 6.0 18.0 5.0
1 ESPORTSTMNT01_2690210 complete NaN LCK CL 2022 Spring 0 2022-01-10 07:44:08 1 12.01 ... 487.0 -107.0 1617.0 23.0 6.0 18.0 5.0 5.0 10.0 6.0
2 ESPORTSTMNT01_2690219 complete NaN LCK CL 2022 Spring 0 2022-01-10 08:38:24 1 12.01 ... 555.0 -1763.0 -906.0 -22.0 1.0 1.0 3.0 3.0 3.0 1.0
3 ESPORTSTMNT01_2690219 complete NaN LCK CL 2022 Spring 0 2022-01-10 08:38:24 1 12.01 ... 533.0 1763.0 906.0 22.0 3.0 3.0 1.0 1.0 1.0 3.0
4 8401-8401_game_1 partial https://lpl.qq.com/es/stats.shtml?bmid=8401 LPL 2022 Spring 0 2022-01-10 09:24:26 1 12.01 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
24867 9687-9687_game_3 partial https://lpl.qq.com/es/stats.shtml?bmid=9687 DC 2022 NaN 0 2022-12-27 10:54:36 3 12.23 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
24868 9687-9687_game_4 partial https://lpl.qq.com/es/stats.shtml?bmid=9687 DC 2022 NaN 0 2022-12-27 11:45:06 4 12.23 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
24869 9687-9687_game_4 partial https://lpl.qq.com/es/stats.shtml?bmid=9687 DC 2022 NaN 0 2022-12-27 11:45:06 4 12.23 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
24870 9687-9687_game_5 partial https://lpl.qq.com/es/stats.shtml?bmid=9687 DC 2022 NaN 0 2022-12-27 12:43:43 5 12.23 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
24871 9687-9687_game_5 partial https://lpl.qq.com/es/stats.shtml?bmid=9687 DC 2022 NaN 0 2022-12-27 12:43:43 5 12.23 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

24872 rows × 123 columns

Now lets go through and address each row's data cleanning needed

Datacompleteness¶

In [11]:
#We have looked at gameid already, lets check datacompleteness
lol_team_data["datacompleteness"].value_counts()
Out[11]:
complete    21234
partial      3638
Name: datacompleteness, dtype: int64
In [12]:
#Lets convert to binary, True if complete, False if Partial
lol_team_data["datacompleteness"] = lol_team_data["datacompleteness"].replace({"complete": True, "partial": False})
lol_team_data = lol_team_data.rename({"datacompleteness": "isdatacomplete"}, axis=1)
lol_team_data["isdatacomplete"].value_counts()
Out[12]:
True     21234
False     3638
Name: isdatacomplete, dtype: int64

URL¶

Url looks like it contains data on where the match data came from if such a place exists (much of url looks to be null). Lets not touch this for now

In [13]:
lol_team_data["url"].value_counts()
Out[13]:
https://lpl.qq.com/es/stats.shtml?bmid=8835                                                                     10
https://lpl.qq.com/es/stats.shtml?bmid=8838                                                                     10
https://lpl.qq.com/es/stats.shtml?bmid=8827                                                                     10
https://lpl.qq.com/es/stats.shtml?bmid=8828                                                                     10
https://lpl.qq.com/es/stats.shtml?bmid=8817                                                                     10
                                                                                                                ..
https://lpl.qq.com/es/stats.shtml?bmid=9036                                                                      2
https://lpl.qq.com/es/stats.shtml?bmid=9037                                                                      2
https://lpl.qq.com/es/stats.shtml?bmid=9144                                                                      2
https://lpl.qq.com/es/stats.shtml?bmid=9038                                                                      2
http://matchhistory.na.leagueoflegends.com/en/#match-details/ESPORTSTMNT04/2220030?gameHash=8d3c977266757ce0     2
Name: url, Length: 926, dtype: int64
In [14]:
lol_team_data["url"].isnull().sum()
Out[14]:
21138

league¶

No null values, looks to be all league data. Looks good to me.

In [15]:
lol_team_data["league"].value_counts()
Out[15]:
LDL                        1884
LPL                        1572
Proving Grounds Circuit    1124
LCSA                       1080
LCK                         934
UPL                         824
SL                          820
LCK CL                      788
NLC                         764
PRM                         712
VCS                         646
LMF                         638
LCS                         612
UL                          556
PCS                         542
EM                          534
LFL                         494
CBLOL                       486
LHE                         486
LEC                         484
ESLOL                       484
LFL2                        482
LAS                         454
TCL                         442
CBLOLA                      432
LJL                         428
LCO                         424
LVP DDH                     418
LPLOL                       418
TAL                         410
GLL                         406
NEXO                        384
LLA                         374
EBL                         370
GL                          348
VL                          340
HC                          324
WCS                         310
HM                          306
PGN                         298
EL                          270
MSI                         160
DC                          154
IC                          150
CDF                         146
LJLA                         76
CT                           52
LCL                          32
Name: league, dtype: int64
In [16]:
lol_team_data["league"].isnull().sum()
Out[16]:
0

Year and Date¶

Going to do these two together becuase this makes sense. Year is redunent data unless there is a mistake in date. Lets do some checking

In [17]:
lol_team_data["date"] = lol_team_data["date"].apply(lambda x: pd.to_datetime(x))
years_match = (lol_team_data["date"].apply(lambda x: x.year) == lol_team_data["year"])
years_match.sum()
Out[17]:
24174
In [18]:
lol_team_data.shape
Out[18]:
(24872, 123)
In [19]:
#And we have mistakes okay lets look at where the years don't match
lol_team_data[~years_match]
Out[19]:
gameid isdatacomplete url league year split playoffs date game patch ... opp_csat15 golddiffat15 xpdiffat15 csdiffat15 killsat15 assistsat15 deathsat15 opp_killsat15 opp_assistsat15 opp_deathsat15
16438 ESPORTSTMNT01_2984361 True NaN LHE 2023 NaN 0 2022-07-11 21:31:02 1 12.12 ... 484.0 -2984.0 -1637.0 -27.0 2.0 5.0 5.0 5.0 6.0 2.0
16439 ESPORTSTMNT01_2984361 True NaN LHE 2023 NaN 0 2022-07-11 21:31:02 1 12.12 ... 457.0 2984.0 1637.0 27.0 5.0 6.0 2.0 2.0 5.0 5.0
16450 ESPORTSTMNT01_2984408 True NaN LHE 2023 NaN 0 2022-07-11 22:46:05 2 12.12 ... 490.0 334.0 -1119.0 -56.0 7.0 13.0 4.0 4.0 8.0 7.0
16451 ESPORTSTMNT01_2984408 True NaN LHE 2023 NaN 0 2022-07-11 22:46:05 2 12.12 ... 434.0 -334.0 1119.0 56.0 4.0 8.0 7.0 7.0 13.0 4.0
16464 ESPORTSTMNT01_2984426 True NaN LHE 2023 NaN 0 2022-07-11 23:49:59 3 12.12 ... 486.0 196.0 -1619.0 9.0 4.0 4.0 7.0 7.0 11.0 4.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
24823 ESPORTSTMNT01_3268686 True NaN NEXO 2023 Split 1 0 2022-12-21 17:16:50 2 12.23 ... 459.0 -853.0 2092.0 -33.0 6.0 12.0 4.0 4.0 5.0 6.0
24824 ESPORTSTMNT01_3269631 True NaN NEXO 2023 Split 1 0 2022-12-21 18:21:45 3 12.23 ... 466.0 2063.0 -1049.0 -28.0 8.0 11.0 5.0 5.0 5.0 8.0
24825 ESPORTSTMNT01_3269631 True NaN NEXO 2023 Split 1 0 2022-12-21 18:21:45 3 12.23 ... 438.0 -2063.0 1049.0 28.0 5.0 5.0 8.0 8.0 11.0 5.0
24826 ESPORTSTMNT01_3268705 True NaN NEXO 2023 Split 1 0 2022-12-21 19:22:53 4 12.23 ... 439.0 2213.0 516.0 18.0 6.0 7.0 5.0 5.0 10.0 6.0
24827 ESPORTSTMNT01_3268705 True NaN NEXO 2023 Split 1 0 2022-12-21 19:22:53 4 12.23 ... 457.0 -2213.0 -516.0 -18.0 5.0 10.0 6.0 6.0 7.0 5.0

698 rows × 123 columns

Okay I looked when the LHE and NEXO's league opening season. According to https://lol.fandom.com/wiki/Liga_de_Honor_Entel/2023_Season/Opening_Promotion the opening to the 2023 season was in July in 2022 and for https://lol.fandom.com/wiki/Liga_Nexo/2023_Season/Split_1 the opening of the 2023 season was in october. I'm going to change year to season to make more logical sense then keep date in pandas datetime object.

In [20]:
lol_team_data = lol_team_data.rename({"year": "season"}, axis=1)

Split¶

In [21]:
lol_team_data["split"].value_counts()
Out[21]:
Summer     7016
Spring     6498
Split 1    1202
Split 2     844
Winter      408
Fall        232
Champ 2     226
Opening     180
Closing     180
Champ 1     164
Pro-Am      144
2022         40
Name: split, dtype: int64
In [22]:
#Categorical and nothing that needs to be changed to nan, next column!

playoffs¶

In [23]:
lol_team_data["playoffs"].value_counts()
Out[23]:
0    20610
1     4262
Name: playoffs, dtype: int64

1 for if game was a playoff, 0 for not playoffs, lets make this boolean.

In [24]:
lol_team_data["playoffs"] = lol_team_data["playoffs"].astype(bool)
lol_team_data["playoffs"].value_counts()
Out[24]:
False    20610
True      4262
Name: playoffs, dtype: int64

'game'¶

Same league matches have best of out 5s. So this checks out.

In [25]:
lol_team_data["game"].value_counts()
Out[25]:
1    16980
2     4454
3     2316
4      774
5      348
Name: game, dtype: int64
In [26]:
lol_team_data["game"].isnull().sum()
Out[26]:
0

Patch¶

In [27]:
lol_team_data["patch"].value_counts()
Out[27]:
12.12    2702
12.04    2648
12.05    2490
12.13    1988
12.02    1936
12.11    1886
12.03    1754
12.01    1616
12.10    1336
12.14    1188
12.18    1038
12.15     920
12.09     704
12.16     570
12.19     394
12.06     374
12.20     366
12.08     362
12.21     200
12.23     172
12.07     162
12.17      48
Name: patch, dtype: int64
In [28]:
lol_team_data["patch"].isnull().sum()
Out[28]:
18

Participantid and Side¶

Doing these together because they seem to be related. Side refers to if the player starts on the blue side of the map or red side

In [29]:
lol_team_data["participantid"].value_counts()
Out[29]:
100    12436
200    12436
Name: participantid, dtype: int64
In [30]:
lol_team_data["side"].value_counts()
Out[30]:
Blue    12436
Red     12436
Name: side, dtype: int64
In [31]:
#Gonna do a test, iff participantid == 100 <=> side == blue?
lol_team_data[(lol_team_data["side"] == "Blue")][["side", "participantid"]].value_counts()
Out[31]:
side  participantid
Blue  100              12436
dtype: int64
In [32]:
lol_team_data[(lol_team_data["side"] == "Red")][["side", "participantid"]].value_counts()
Out[32]:
side  participantid
Red   200              12436
dtype: int64

So participantid and side are interchangeable. Side gives us a little more information (becuase I vaugely recall sides having slight avatanges... maybe something to look into later). For now I'll drop participantid and convert side to bool, True if on blue side, False if on Red.

In [33]:
lol_team_data = lol_team_data.drop("participantid", axis=1)
In [34]:
lol_team_data["side"] = lol_team_data["side"].replace({"Blue": True, "Red": False})
lol_team_data = lol_team_data.rename({"side": "onblueside"}, axis=1)
lol_team_data["onblueside"].value_counts()
Out[34]:
True     12436
False    12436
Name: onblueside, dtype: int64

position¶

In [35]:
lol_team_data["position"].value_counts()
Out[35]:
team    24872
Name: position, dtype: int64
In [36]:
#position litterally refers to team.... I will check this later...
#For now lets drop it becuase it doesn't give any useful information
lol_team_data = lol_team_data.drop("position", axis=1)

Playername¶

In [37]:
lol_team_data["playername"].isnull().sum() == lol_team_data.shape[0]
Out[37]:
True
In [38]:
#Drop becuse column litterly doesn't contain any information
lol_team_data = lol_team_data.drop("playername", axis=1)

Playerid¶

In [39]:
lol_team_data["playerid"].isnull().sum() == lol_team_data.shape[0]
Out[39]:
True
In [40]:
#Drop becuse column doesn't contain any information
lol_team_data = lol_team_data.drop("playerid", axis=1)

Teamname, teamid¶

In [41]:
lol_team_data["teamname"].value_counts()
Out[41]:
unknown team           382
Royal Never Give Up    162
T1                     144
DRX                    131
Top Esports            128
                      ... 
AYM Esports              2
Team Fighter             1
BT Excel                 1
Master Girl              1
Wulf Pack Cascade        1
Name: teamname, Length: 593, dtype: int64
In [42]:
lol_team_data["teamname"] = lol_team_data["teamname"].replace({"unknown team", np.NaN})
In [43]:
lol_team_data["teamname"].value_counts()
Out[43]:
unknown team           382
Royal Never Give Up    162
T1                     144
DRX                    131
Top Esports            128
                      ... 
AYM Esports              2
Team Fighter             1
BT Excel                 1
Master Girl              1
Wulf Pack Cascade        1
Name: teamname, Length: 593, dtype: int64
In [44]:
## TODO FIX THIS BUG!!!
In [45]:
#We already looked at teamid

chamption¶

In [46]:
lol_team_data["champion"].isnull().sum() == lol_team_data.shape[0]
Out[46]:
True
In [47]:
#remove due to having no data
lol_team_data = lol_team_data.drop("champion", axis=1)

The Bans¶

In [48]:
lol_team_data[["ban1", "ban2","ban3","ban4","ban5",]]
Out[48]:
ban1 ban2 ban3 ban4 ban5
0 Karma Caitlyn Syndra Thresh Lulu
1 Lee Sin Twisted Fate Zoe Nautilus Rell
2 Sona Jarvan IV Caitlyn Lulu Lucian
3 LeBlanc Yuumi Twisted Fate Karma Alistar
4 Renekton Lee Sin Caitlyn Jayce Camille
... ... ... ... ... ...
24867 K'Sante Syndra Lucian Ahri Sylas
24868 K'Sante Syndra Wukong Ahri Gwen
24869 Fiora Lucian Aatrox Jax Camille
24870 Fiora Aatrox Yuumi Camille Gnar
24871 K'Sante Syndra Lucian Gwen Sylas

24872 rows × 5 columns

In [49]:
lol_team_data[["ban1", "ban2","ban3","ban4","ban5",]].isnull().sum()
Out[49]:
ban1    390
ban2    367
ban3    420
ban4    398
ban5    452
dtype: int64
In [50]:
lol_team_data.shape[0]
Out[50]:
24872
In [51]:
#Looks okay to me for now...
In [52]:
lol_team_data['gamelength']
Out[52]:
0        1713
1        1713
2        2114
3        2114
4        1365
         ... 
24867    1834
24868    2111
24869    2111
24870    1778
24871    1778
Name: gamelength, Length: 24872, dtype: int64
In [53]:
#Looks to be in seconds, looks okay

The rest of the columns¶

The rest of the columns refer to gameplay elements. Going through the columns manually will take a bit too long given there are 100 columns left so its time to automate some things.

I'm going to loop through each function and print out the following

  • number of unique values
  • top 10 most common elements in the column
  • type of the column

I'll also use describe() to get a feel for my dataset...

This should help me make a decision about how to clean each column a bit faster

In [54]:
#I've kept track of all remaining columns manually
cols = ['result', 'kills', 'deaths', 'assists', 'teamkills', 'teamdeaths',
       'doublekills', 'triplekills', 'quadrakills', 'pentakills',
       'firstblood', 'firstbloodkill', 'firstbloodassist',
       'firstbloodvictim', 'team kpm', 'ckpm', 'firstdragon', 'dragons',
       'opp_dragons', 'elementaldrakes', 'opp_elementaldrakes',
       'infernals', 'mountains', 'clouds', 'oceans', 'chemtechs',
       'hextechs', 'dragons (type unknown)', 'elders', 'opp_elders',
       'firstherald', 'heralds', 'opp_heralds', 'firstbaron', 'barons',
       'opp_barons', 'firsttower', 'towers', 'opp_towers',
       'firstmidtower', 'firsttothreetowers', 'turretplates',
       'opp_turretplates', 'inhibitors', 'opp_inhibitors',
       'damagetochampions', 'dpm', 'damageshare', 'damagetakenperminute',
       'damagemitigatedperminute', 'wardsplaced', 'wpm', 'wardskilled',
       'wcpm', 'controlwardsbought', 'visionscore', 'vspm', 'totalgold',
       'earnedgold', 'earned gpm', 'earnedgoldshare', 'goldspent', 'gspd',
       'total cs', 'minionkills', 'monsterkills', 'monsterkillsownjungle',
       'monsterkillsenemyjungle', 'cspm', 'goldat10', 'xpat10', 'csat10',
       'opp_goldat10', 'opp_xpat10', 'opp_csat10', 'golddiffat10',
       'xpdiffat10', 'csdiffat10', 'killsat10', 'assistsat10',
       'deathsat10', 'opp_killsat10', 'opp_assistsat10', 'opp_deathsat10',
       'goldat15', 'xpat15', 'csat15', 'opp_goldat15', 'opp_xpat15',
       'opp_csat15', 'golddiffat15', 'xpdiffat15', 'csdiffat15',
       'killsat15', 'assistsat15', 'deathsat15', 'opp_killsat15',
       'opp_assistsat15', 'opp_deathsat15']
In [55]:
lol_team_data[cols].describe()
Out[55]:
result kills deaths assists teamkills teamdeaths doublekills triplekills quadrakills pentakills ... opp_csat15 golddiffat15 xpdiffat15 csdiffat15 killsat15 assistsat15 deathsat15 opp_killsat15 opp_assistsat15 opp_deathsat15
count 24872.00000 24872.000000 24872.000000 24872.000000 24872.000000 24872.000000 21234.000000 21234.000000 21234.000000 21234.000000 ... 21234.000000 21234.000000 21234.000000 21234.000000 21234.000000 21234.000000 21234.000000 21234.000000 21234.000000 21234.000000
mean 0.49992 14.478651 14.507639 32.304559 14.478651 14.507639 1.690732 0.307102 0.052039 0.009701 ... 502.478195 0.000000 0.000000 0.000000 4.073938 6.586324 4.083969 4.073938 6.586324 4.083969
std 0.50001 7.525194 7.523725 17.996857 7.525194 7.523725 1.595011 0.583465 0.235091 0.098498 ... 37.745643 3212.632589 2097.269577 42.963113 2.977552 5.288468 2.982984 2.977552 5.288468 2.982984
min 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... 318.000000 -15041.000000 -10019.000000 -221.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
25% 0.00000 8.000000 8.000000 17.000000 8.000000 8.000000 0.000000 0.000000 0.000000 0.000000 ... 478.000000 -1978.500000 -1287.000000 -28.000000 2.000000 3.000000 2.000000 2.000000 3.000000 2.000000
50% 0.00000 14.000000 14.000000 32.000000 14.000000 14.000000 1.000000 0.000000 0.000000 0.000000 ... 505.000000 0.000000 0.000000 0.000000 4.000000 5.000000 4.000000 4.000000 5.000000 4.000000
75% 1.00000 20.000000 20.000000 45.000000 20.000000 20.000000 3.000000 1.000000 0.000000 0.000000 ... 529.000000 1978.500000 1287.000000 28.000000 6.000000 9.000000 6.000000 6.000000 9.000000 6.000000
max 1.00000 60.000000 60.000000 120.000000 60.000000 60.000000 11.000000 6.000000 3.000000 2.000000 ... 626.000000 15041.000000 10019.000000 221.000000 28.000000 47.000000 28.000000 28.000000 47.000000 28.000000

8 rows × 99 columns

In [56]:
for col in cols:
    print(col)
    display(lol_team_data[col].value_counts())
    display(lol_team_data[col].unique().shape[0])
    display(lol_team_data[col].isnull().sum() == lol_team_data.shape[0])
    display(lol_team_data[col].dtype)
    print("==============================")
result
0    12438
1    12434
Name: result, dtype: int64
2
False
dtype('int64')
==============================
kills
17    1175
18    1161
14    1128
16    1122
15    1119
19    1083
13    1079
8     1072
7     1060
20    1051
6     1042
10    1036
12    1030
9     1021
5      976
11     968
21     939
22     833
4      833
23     706
3      673
24     620
25     503
2      459
26     413
27     336
28     254
1      219
29     203
30     196
31     137
32      83
0       75
33      68
34      53
36      42
35      31
37      24
38      11
39      10
40       8
46       4
42       4
41       3
45       3
57       1
48       1
49       1
60       1
43       1
58       1
Name: kills, dtype: int64
51
False
dtype('int64')
==============================
deaths
17    1174
18    1170
15    1126
16    1125
14    1114
13    1086
19    1081
8     1080
6     1052
7     1044
20    1040
10    1038
12    1027
9     1025
11     974
5      971
21     955
4      823
22     820
23     714
3      667
24     628
25     502
2      445
26     412
27     340
28     255
1      215
29     205
30     195
31     139
32      86
0       74
33      70
34      53
36      39
35      32
37      27
39      12
38       9
40       8
42       4
46       4
41       3
45       3
57       1
48       1
49       1
60       1
43       1
58       1
Name: deaths, dtype: int64
51
False
dtype('int64')
==============================
assists
19     489
41     487
13     480
39     479
40     479
      ... 
113      1
115      1
117      1
106      1
109      1
Name: assists, Length: 108, dtype: int64
108
False
dtype('int64')
==============================
teamkills
17    1175
18    1161
14    1128
16    1122
15    1119
19    1083
13    1079
8     1072
7     1060
20    1051
6     1042
10    1036
12    1030
9     1021
5      976
11     968
21     939
22     833
4      833
23     706
3      673
24     620
25     503
2      459
26     413
27     336
28     254
1      219
29     203
30     196
31     137
32      83
0       75
33      68
34      53
36      42
35      31
37      24
38      11
39      10
40       8
46       4
42       4
41       3
45       3
57       1
48       1
49       1
60       1
43       1
58       1
Name: teamkills, dtype: int64
51
False
dtype('int64')
==============================
teamdeaths
17    1174
18    1170
15    1126
16    1125
14    1114
13    1086
19    1081
8     1080
6     1052
7     1044
20    1040
10    1038
12    1027
9     1025
11     974
5      971
21     955
4      823
22     820
23     714
3      667
24     628
25     502
2      445
26     412
27     340
28     255
1      215
29     205
30     195
31     139
32      86
0       74
33      70
34      53
36      39
35      32
37      27
39      12
38       9
40       8
42       4
46       4
41       3
45       3
57       1
48       1
49       1
60       1
43       1
58       1
Name: teamdeaths, dtype: int64
51
False
dtype('int64')
==============================
doublekills
0.0     6182
1.0     5012
2.0     4112
3.0     2962
4.0     1708
5.0      811
6.0      298
7.0      108
8.0       25
9.0       14
11.0       2
Name: doublekills, dtype: int64
12
False
dtype('float64')
==============================
triplekills
0.0    15899
1.0     4304
2.0      887
3.0      135
4.0        8
6.0        1
Name: triplekills, dtype: int64
7
False
dtype('float64')
==============================
quadrakills
0.0    20190
1.0      985
2.0       57
3.0        2
Name: quadrakills, dtype: int64
5
False
dtype('float64')
==============================
pentakills
0.0    21029
1.0      204
2.0        1
Name: pentakills, dtype: int64
4
False
dtype('float64')
==============================
firstblood
0.0    12454
1.0    12416
Name: firstblood, dtype: int64
3
False
dtype('float64')
==============================
firstbloodkill
Series([], Name: firstbloodkill, dtype: int64)
1
True
dtype('float64')
==============================
firstbloodassist
Series([], Name: firstbloodassist, dtype: int64)
1
True
dtype('float64')
==============================
firstbloodvictim
Series([], Name: firstbloodvictim, dtype: int64)
1
True
dtype('float64')
==============================
team kpm
0.0000    75
0.5825    17
0.6122    16
0.5000    16
0.5941    16
          ..
0.9383     1
0.6434     1
1.1890     1
0.1381     1
0.7351     1
Name: team kpm, Length: 8371, dtype: int64
8371
False
dtype('float64')
==============================
ckpm
0.8108    28
0.8571    26
1.0169    26
0.7143    24
0.7059    22
          ..
1.6139     2
1.4216     2
0.4466     2
0.6289     2
0.9786     2
Name: ckpm, Length: 6886, dtype: int64
6886
False
dtype('float64')
==============================
firstdragon
0.0    10619
1.0    10615
Name: firstdragon, dtype: int64
3
False
dtype('float64')
==============================
dragons
2.0    5829
3.0    5751
1.0    4806
4.0    4557
0.0    3208
5.0     688
6.0      32
7.0       1
Name: dragons, dtype: int64
8
False
dtype('float64')
==============================
opp_dragons
2.0    5829
3.0    5751
1.0    4806
4.0    4557
0.0    3208
5.0     688
6.0      32
7.0       1
Name: opp_dragons, dtype: int64
8
False
dtype('float64')
==============================
elementaldrakes
2.0    4926
3.0    4807
4.0    4514
1.0    4065
0.0    2834
Name: elementaldrakes, dtype: int64
6
False
dtype('float64')
==============================
opp_elementaldrakes
2.0    4926
3.0    4807
4.0    4514
1.0    4065
0.0    2834
Name: opp_elementaldrakes, dtype: int64
6
False
dtype('float64')
==============================
infernals
0.0    14098
1.0     5435
2.0     1296
3.0      352
4.0       53
Name: infernals, dtype: int64
6
False
dtype('float64')
==============================
mountains
0.0    14124
1.0     5493
2.0     1195
3.0      383
4.0       39
Name: mountains, dtype: int64
6
False
dtype('float64')
==============================
clouds
0.0    14155
1.0     5388
2.0     1273
3.0      375
4.0       43
Name: clouds, dtype: int64
6
False
dtype('float64')
==============================
oceans
0.0    14230
1.0     5285
2.0     1288
3.0      399
4.0       32
Name: oceans, dtype: int64
6
False
dtype('float64')
==============================
chemtechs
0.0    20711
1.0      334
2.0       77
3.0       20
4.0        4
Name: chemtechs, dtype: int64
6
False
dtype('float64')
==============================
hextechs
0.0    14159
1.0     5349
2.0     1230
3.0      360
4.0       48
Name: hextechs, dtype: int64
6
False
dtype('float64')
==============================
dragons (type unknown)
3.0    1033
2.0     960
4.0     870
1.0     811
0.0     594
5.0      21
6.0       3
Name: dragons (type unknown), dtype: int64
8
False
dtype('float64')
==============================
elders
0.0    20156
1.0     1020
2.0       56
3.0        2
Name: elders, dtype: int64
5
False
dtype('float64')
==============================
opp_elders
0.0    20156
1.0     1020
2.0       56
3.0        2
Name: opp_elders, dtype: int64
5
False
dtype('float64')
==============================
firstherald
0.0    10620
1.0    10614
Name: firstherald, dtype: int64
3
False
dtype('float64')
==============================
heralds
1.0    8064
0.0    6726
2.0    6444
Name: heralds, dtype: int64
4
False
dtype('float64')
==============================
opp_heralds
1.0    8064
0.0    6726
2.0    6444
Name: opp_heralds, dtype: int64
4
False
dtype('float64')
==============================
firstbaron
0.0    11174
1.0    10060
Name: firstbaron, dtype: int64
3
False
dtype('float64')
==============================
barons
0.0    11578
1.0    10118
2.0     2896
3.0      270
4.0       10
Name: barons, dtype: int64
5
False
dtype('float64')
==============================
opp_barons
0.0    11578
1.0    10118
2.0     2896
3.0      270
4.0       10
Name: opp_barons, dtype: int64
5
False
dtype('float64')
==============================
firsttower
1.0    10617
0.0    10617
Name: firsttower, dtype: int64
3
False
dtype('float64')
==============================
towers
9.0     3499
10.0    3099
2.0     2791
3.0     2738
11.0    2557
8.0     2295
1.0     2059
4.0     1568
7.0     1500
0.0     1156
5.0      923
6.0      687
Name: towers, dtype: int64
12
False
dtype('float64')
==============================
opp_towers
9.0     3499
10.0    3099
2.0     2791
3.0     2738
11.0    2557
8.0     2295
1.0     2059
4.0     1568
7.0     1500
0.0     1156
5.0      923
6.0      687
Name: opp_towers, dtype: int64
12
False
dtype('float64')
==============================
firstmidtower
1.0    10615
0.0    10615
Name: firstmidtower, dtype: int64
3
False
dtype('float64')
==============================
firsttothreetowers
0.0    10619
1.0    10615
Name: firsttothreetowers, dtype: int64
3
False
dtype('float64')
==============================
turretplates
4.0     2862
5.0     2853
3.0     2795
6.0     2487
2.0     2457
7.0     1814
1.0     1734
8.0     1236
0.0      869
9.0      799
10.0     537
11.0     336
12.0     191
13.0      94
15.0      48
14.0      34
Name: turretplates, dtype: int64
17
False
dtype('float64')
==============================
opp_turretplates
4.0     2862
5.0     2853
3.0     2795
6.0     2487
2.0     2457
7.0     1814
1.0     1734
8.0     1236
0.0      869
9.0      799
10.0     537
11.0     336
12.0     191
13.0      94
15.0      48
14.0      34
Name: opp_turretplates, dtype: int64
17
False
dtype('float64')
==============================
inhibitors
0.0    11504
1.0     6822
2.0     4061
3.0     1966
4.0      359
5.0      122
6.0       23
7.0        9
8.0        3
9.0        1
Name: inhibitors, dtype: int64
11
False
dtype('float64')
==============================
opp_inhibitors
0.0    11504
1.0     6822
2.0     4061
3.0     1966
4.0      359
5.0      122
6.0       23
7.0        9
8.0        3
9.0        1
Name: opp_inhibitors, dtype: int64
11
False
dtype('float64')
==============================
damagetochampions
70414.0    6
49188.0    6
64928.0    5
54935.0    4
47765.0    4
          ..
78768.0    1
71861.0    1
81893.0    1
34014.0    1
77748.0    1
Name: damagetochampions, Length: 21161, dtype: int64
21162
False
dtype('float64')
==============================
dpm
1856.7087    3
1940.9584    3
1944.7660    2
2643.6345    2
1080.0000    2
            ..
1815.0239    1
1642.5246    1
2251.7597    1
2531.5914    1
2623.6670    1
Name: dpm, Length: 24784, dtype: int64
24785
False
dtype('float64')
==============================
damageshare
Series([], Name: damageshare, dtype: int64)
1
True
dtype('float64')
==============================
damagetakenperminute
2649.4199    3
3003.0265    3
3381.2685    2
3971.2844    2
3906.9741    2
            ..
2530.8599    1
2673.9803    1
3139.8031    1
3519.1359    1
2486.5579    1
Name: damagetakenperminute, Length: 24779, dtype: int64
24780
False
dtype('float64')
==============================
damagemitigatedperminute
2725.1198    3
2296.8348    3
1940.4032    2
3941.8899    2
2670.6110    2
            ..
2587.3016    1
4521.1485    1
3489.5287    1
2440.4672    1
3141.8929    1
Name: damagemitigatedperminute, Length: 21167, dtype: int64
21168
False
dtype('float64')
==============================
wardsplaced
81.0     392
77.0     385
89.0     380
91.0     377
88.0     376
        ... 
220.0      1
225.0      1
214.0      1
234.0      1
22.0       1
Name: wardsplaced, Length: 209, dtype: int64
210
False
dtype('float64')
==============================
wpm
3.0000    42
3.1579    34
2.8571    31
2.7273    24
2.6087    23
          ..
4.0801     1
3.9710     1
3.3949     1
2.6762     1
4.1170     1
Name: wpm, Length: 13193, dtype: int64
13194
False
dtype('float64')
==============================
wardskilled
35.0     633
38.0     633
36.0     631
40.0     604
34.0     603
        ... 
118.0      1
1.0        1
128.0      1
117.0      1
123.0      1
Name: wardskilled, Length: 123, dtype: int64
124
False
dtype('float64')
==============================
wcpm
1.4286    26
1.3636    26
1.5789    24
1.2500    20
1.1765    19
          ..
1.5977     1
2.0897     1
1.6911     1
1.2933     1
2.2454     1
Name: wcpm, Length: 11047, dtype: int64
11048
False
dtype('float64')
==============================
controlwardsbought
35.0     853
33.0     823
36.0     772
30.0     769
37.0     767
        ... 
102.0      1
92.0       1
110.0      1
107.0      1
4.0        1
Name: controlwardsbought, Length: 93, dtype: int64
94
False
dtype('float64')
==============================
visionscore
204.0    174
212.0    166
218.0    165
203.0    165
193.0    163
        ... 
526.0      1
502.0      1
61.0       1
485.0      1
493.0      1
Name: visionscore, Length: 447, dtype: int64
448
False
dtype('float64')
==============================
vspm
7.5000    39
6.6667    33
7.0588    25
6.0000    25
8.5714    18
          ..
8.0641     1
9.7730     1
8.4375     1
6.9375     1
9.9888     1
Name: vspm, Length: 17777, dtype: int64
17778
False
dtype('float64')
==============================
totalgold
60312    6
57171    6
47182    6
66408    6
57071    6
        ..
34105    1
43719    1
50767    1
60574    1
45976    1
Name: totalgold, Length: 18470, dtype: int64
18470
False
dtype('int64')
==============================
earnedgold
37347.0    7
29184.0    6
40011.0    6
36620.0    6
32281.0    6
          ..
27061.0    1
24582.0    1
33325.0    1
23788.0    1
26462.0    1
Name: earnedgold, Length: 17188, dtype: int64
17189
False
dtype('float64')
==============================
earned gpm
1005.0000    3
1411.7024    3
944.1110     3
1029.9195    2
990.5750     2
            ..
1457.7254    1
1313.5584    1
1006.9480    1
1032.2023    1
1349.7638    1
Name: earned gpm, Length: 24737, dtype: int64
24738
False
dtype('float64')
==============================
earnedgoldshare
Series([], Name: earnedgoldshare, dtype: int64)
1
True
dtype('float64')
==============================
goldspent
48550.0    20
48150.0    19
50150.0    18
46775.0    18
52100.0    18
           ..
49106.0     1
45915.0     1
53019.0     1
43879.0     1
52343.0     1
Name: goldspent, Length: 11603, dtype: int64
11604
False
dtype('float64')
==============================
gspd
-0.185767    3
 0.185767    3
 0.218182    3
-0.218182    3
 0.181053    2
            ..
-0.107400    1
 0.107400    1
 0.033272    1
-0.033272    1
 0.189626    1
Name: gspd, Length: 24532, dtype: int64
24533
False
dtype('float64')
==============================
total cs
Series([], Name: total cs, dtype: int64)
1
True
dtype('float64')
==============================
minionkills
740.0     79
829.0     78
746.0     76
774.0     74
769.0     73
          ..
1403.0     1
1301.0     1
1231.0     1
1245.0     1
409.0      1
Name: minionkills, Length: 967, dtype: int64
968
False
dtype('float64')
==============================
monsterkills
191.0    222
199.0    221
204.0    220
194.0    220
187.0    216
        ... 
62.0       1
414.0      1
376.0      1
75.0       1
64.0       1
Name: monsterkills, Length: 331, dtype: int64
332
False
dtype('float64')
==============================
monsterkillsownjungle
136.0    64
131.0    61
121.0    58
125.0    57
132.0    56
         ..
233.0     1
222.0     1
210.0     1
250.0     1
43.0      1
Name: monsterkillsownjungle, Length: 184, dtype: int64
185
False
dtype('float64')
==============================
monsterkillsenemyjungle
0.0     263
4.0     263
8.0     196
12.0    162
16.0    133
       ... 
97.0      1
86.0      1
70.0      1
80.0      1
71.0      1
Name: monsterkillsenemyjungle, Length: 77, dtype: int64
78
False
dtype('float64')
==============================
cspm
30.0000    50
32.7273    14
33.3333    12
31.7647    10
30.9091     7
           ..
33.8230     1
31.1745     1
26.6845     1
31.2419     1
28.8439     1
Name: cspm, Length: 18392, dtype: int64
18393
False
dtype('float64')
==============================
goldat10
15164.0    19
15473.0    19
15275.0    18
15581.0    18
15228.0    18
           ..
18490.0     1
16881.0     1
14067.0     1
18991.0     1
13303.0     1
Name: goldat10, Length: 4493, dtype: int64
4494
False
dtype('float64')
==============================
xpat10
18123.0    25
18079.0    21
17715.0    21
18547.0    20
18467.0    20
           ..
16591.0     1
15930.0     1
16159.0     1
15915.0     1
16988.0     1
Name: xpat10, Length: 3979, dtype: int64
3980
False
dtype('float64')
==============================
csat10
314.0    363
319.0    358
315.0    352
327.0    350
321.0    348
        ... 
212.0      1
208.0      1
199.0      1
216.0      1
214.0      1
Name: csat10, Length: 181, dtype: int64
182
False
dtype('float64')
==============================
opp_goldat10
15164.0    19
15473.0    19
15245.0    18
15275.0    18
15641.0    18
           ..
18083.0     1
13260.0     1
18319.0     1
14646.0     1
13303.0     1
Name: opp_goldat10, Length: 4493, dtype: int64
4494
False
dtype('float64')
==============================
opp_xpat10
18123.0    25
17715.0    21
18079.0    21
18405.0    20
18547.0    20
           ..
16591.0     1
15930.0     1
16159.0     1
16414.0     1
16988.0     1
Name: opp_xpat10, Length: 3979, dtype: int64
3980
False
dtype('float64')
==============================
opp_csat10
314.0    363
319.0    358
315.0    352
327.0    350
321.0    348
        ... 
212.0      1
208.0      1
199.0      1
216.0      1
214.0      1
Name: opp_csat10, Length: 181, dtype: int64
182
False
dtype('float64')
==============================
golddiffat10
-82.0      15
-1055.0    15
 82.0      15
 1055.0    15
-347.0     13
           ..
-3643.0     1
 3643.0     1
 2265.0     1
-2265.0     1
-1510.0     1
Name: golddiffat10, Length: 6331, dtype: int64
6332
False
dtype('float64')
==============================
xpdiffat10
 16.0      18
-16.0      18
-93.0      17
 93.0      17
 85.0      16
           ..
-3422.0     1
 3422.0     1
-2355.0     1
 2355.0     1
-2737.0     1
Name: xpdiffat10, Length: 4943, dtype: int64
4944
False
dtype('float64')
==============================
csdiffat10
 0.0      332
-2.0      322
 2.0      322
 7.0      320
-7.0      320
         ... 
-111.0      1
 111.0      1
-110.0      1
 110.0      1
-121.0      1
Name: csdiffat10, Length: 209, dtype: int64
210
False
dtype('float64')
==============================
killsat10
1.0     5128
2.0     4393
0.0     4101
3.0     3175
4.0     2006
5.0     1135
6.0      595
7.0      329
8.0      180
9.0       95
10.0      57
11.0      17
13.0       9
12.0       9
14.0       3
15.0       2
Name: killsat10, dtype: int64
17
False
dtype('float64')
==============================
assistsat10
0.0     4766
2.0     3281
1.0     2834
3.0     2356
4.0     1987
5.0     1478
6.0     1258
7.0      835
8.0      681
9.0      488
10.0     350
11.0     271
12.0     185
13.0     139
14.0      90
15.0      72
16.0      48
17.0      37
18.0      25
19.0      15
20.0      13
22.0       8
21.0       7
23.0       5
25.0       1
35.0       1
31.0       1
28.0       1
24.0       1
Name: assistsat10, dtype: int64
30
False
dtype('float64')
==============================
deathsat10
1.0     5120
2.0     4393
0.0     4079
3.0     3184
4.0     2007
5.0     1142
6.0      596
7.0      337
8.0      182
9.0       94
10.0      60
11.0      16
12.0      10
13.0       9
14.0       3
15.0       2
Name: deathsat10, dtype: int64
17
False
dtype('float64')
==============================
opp_killsat10
1.0     5128
2.0     4393
0.0     4101
3.0     3175
4.0     2006
5.0     1135
6.0      595
7.0      329
8.0      180
9.0       95
10.0      57
11.0      17
13.0       9
12.0       9
14.0       3
15.0       2
Name: opp_killsat10, dtype: int64
17
False
dtype('float64')
==============================
opp_assistsat10
0.0     4766
2.0     3281
1.0     2834
3.0     2356
4.0     1987
5.0     1478
6.0     1258
7.0      835
8.0      681
9.0      488
10.0     350
11.0     271
12.0     185
13.0     139
14.0      90
15.0      72
16.0      48
17.0      37
18.0      25
19.0      15
20.0      13
22.0       8
21.0       7
23.0       5
25.0       1
35.0       1
31.0       1
28.0       1
24.0       1
Name: opp_assistsat10, dtype: int64
30
False
dtype('float64')
==============================
opp_deathsat10
1.0     5120
2.0     4393
0.0     4079
3.0     3184
4.0     2007
5.0     1142
6.0      596
7.0      337
8.0      182
9.0       94
10.0      60
11.0      16
12.0      10
13.0       9
14.0       3
15.0       2
Name: opp_deathsat10, dtype: int64
17
False
dtype('float64')
==============================
goldat15
24264.0    14
24752.0    14
24842.0    14
23299.0    13
25468.0    13
           ..
29531.0     1
28652.0     1
30964.0     1
30227.0     1
20526.0     1
Name: goldat15, Length: 7128, dtype: int64
7129
False
dtype('float64')
==============================
xpat15
29083.0    16
30025.0    15
29327.0    15
29499.0    15
30080.0    15
           ..
30618.0     1
31543.0     1
25592.0     1
27583.0     1
25873.0     1
Name: xpat15, Length: 5935, dtype: int64
5936
False
dtype('float64')
==============================
csat15
519.0    250
514.0    250
508.0    249
505.0    244
515.0    240
        ... 
344.0      1
332.0      1
618.0      1
342.0      1
334.0      1
Name: csat15, Length: 264, dtype: int64
265
False
dtype('float64')
==============================
opp_goldat15
24752.0    14
24264.0    14
24842.0    14
25468.0    13
23299.0    13
           ..
28151.0     1
30396.0     1
28214.0     1
26976.0     1
30489.0     1
Name: opp_goldat15, Length: 7128, dtype: int64
7129
False
dtype('float64')
==============================
opp_xpat15
29083.0    16
29466.0    15
30080.0    15
30025.0    15
29327.0    15
           ..
28603.0     1
25435.0     1
26778.0     1
32859.0     1
31574.0     1
Name: opp_xpat15, Length: 5935, dtype: int64
5936
False
dtype('float64')
==============================
opp_csat15
514.0    250
519.0    250
508.0    249
505.0    244
515.0    240
        ... 
374.0      1
324.0      1
342.0      1
332.0      1
334.0      1
Name: opp_csat15, Length: 264, dtype: int64
265
False
dtype('float64')
==============================
golddiffat15
 319.0     11
-319.0     11
-1854.0     9
 78.0       9
-78.0       9
           ..
 5118.0     1
-7916.0     1
 7916.0     1
-1603.0     1
-4901.0     1
Name: golddiffat15, Length: 10012, dtype: int64
10013
False
dtype('float64')
==============================
xpdiffat15
 247.0     12
-247.0     12
 499.0     11
 259.0     11
-499.0     11
           ..
 5591.0     1
 877.0      1
-877.0      1
 5532.0     1
-4035.0     1
Name: xpdiffat15, Length: 7803, dtype: int64
7804
False
dtype('float64')
==============================
csdiffat15
 1.0      223
-1.0      223
 8.0      223
-8.0      223
-13.0     209
         ... 
-175.0      1
 175.0      1
-149.0      1
 149.0      1
-221.0      1
Name: csdiffat15, Length: 303, dtype: int64
304
False
dtype('float64')
==============================
killsat15
2.0     3323
3.0     3260
4.0     2808
1.0     2665
5.0     2340
6.0     1703
0.0     1336
7.0     1210
8.0      818
9.0      629
10.0     404
11.0     250
12.0     170
13.0     112
14.0      59
15.0      43
16.0      37
17.0      30
18.0      12
19.0      10
21.0       5
20.0       5
23.0       2
24.0       1
22.0       1
28.0       1
Name: killsat15, dtype: int64
27
False
dtype('float64')
==============================
assistsat15
2.0     2010
4.0     1959
3.0     1923
5.0     1732
0.0     1676
6.0     1641
7.0     1390
1.0     1384
8.0     1264
9.0     1111
10.0     971
11.0     805
12.0     620
13.0     508
14.0     424
15.0     348
16.0     299
17.0     253
18.0     197
19.0     172
20.0     119
21.0      87
22.0      78
23.0      59
25.0      44
24.0      43
26.0      27
27.0      21
28.0      20
30.0      14
31.0       7
29.0       6
34.0       4
32.0       4
33.0       4
38.0       3
36.0       2
47.0       1
41.0       1
35.0       1
37.0       1
40.0       1
Name: assistsat15, dtype: int64
43
False
dtype('float64')
==============================
deathsat15
2.0     3307
3.0     3269
4.0     2802
1.0     2657
5.0     2351
6.0     1703
0.0     1328
7.0     1216
8.0      817
9.0      620
10.0     417
11.0     254
12.0     171
13.0     116
14.0      57
15.0      45
16.0      37
17.0      29
18.0      13
19.0       9
20.0       6
21.0       5
23.0       2
24.0       1
22.0       1
28.0       1
Name: deathsat15, dtype: int64
27
False
dtype('float64')
==============================
opp_killsat15
2.0     3323
3.0     3260
4.0     2808
1.0     2665
5.0     2340
6.0     1703
0.0     1336
7.0     1210
8.0      818
9.0      629
10.0     404
11.0     250
12.0     170
13.0     112
14.0      59
15.0      43
16.0      37
17.0      30
18.0      12
19.0      10
21.0       5
20.0       5
23.0       2
24.0       1
22.0       1
28.0       1
Name: opp_killsat15, dtype: int64
27
False
dtype('float64')
==============================
opp_assistsat15
2.0     2010
4.0     1959
3.0     1923
5.0     1732
0.0     1676
6.0     1641
7.0     1390
1.0     1384
8.0     1264
9.0     1111
10.0     971
11.0     805
12.0     620
13.0     508
14.0     424
15.0     348
16.0     299
17.0     253
18.0     197
19.0     172
20.0     119
21.0      87
22.0      78
23.0      59
25.0      44
24.0      43
26.0      27
27.0      21
28.0      20
30.0      14
31.0       7
29.0       6
34.0       4
32.0       4
33.0       4
38.0       3
36.0       2
47.0       1
41.0       1
35.0       1
37.0       1
40.0       1
Name: opp_assistsat15, dtype: int64
43
False
dtype('float64')
==============================
opp_deathsat15
2.0     3307
3.0     3269
4.0     2802
1.0     2657
5.0     2351
6.0     1703
0.0     1328
7.0     1216
8.0      817
9.0      620
10.0     417
11.0     254
12.0     171
13.0     116
14.0      57
15.0      45
16.0      37
17.0      29
18.0      13
19.0       9
20.0       6
21.0       5
23.0       2
24.0       1
22.0       1
28.0       1
Name: opp_deathsat15, dtype: int64
27
False
dtype('float64')
==============================

Looking through output, here are a few notes

columns that should be booleans because they have 2 data points (note all of these )

  • result
  • firstblood
  • firstdragon
  • firstherald
  • firstbaron
  • firsttower
  • firstmidtower
  • firsttothreetowers

columns with no information

  • firstbloodkill
  • firstbloodassist
  • firstbloodvictim
  • damageshare
  • earnedgoldshare
  • total cs
In [57]:
#Lets remove all the useless columns and set booleans appropetly
lol_team_data = lol_team_data.drop([
    "firstbloodkill", "firstbloodassist", "firstbloodvictim", "damageshare", "earnedgoldshare", "total cs"
], axis=1)

#find boolean values then process them
lol_team_data_bool_cols = lol_team_data.apply(lambda s: s.value_counts().shape[0] == 2)
lol_team_data.loc[:,lol_team_data_bool_cols]= lol_team_data.loc[:, lol_team_data_bool_cols].replace({1: True, 0:False}).astype(bool)
In [58]:
lol_team_data["result"]
Out[58]:
0        False
1         True
2        False
3         True
4         True
         ...  
24867    False
24868     True
24869    False
24870    False
24871     True
Name: result, Length: 24872, dtype: bool

That I believe concludes our data cleaning work!

In [59]:
lol_team_data.head()
Out[59]:
gameid isdatacomplete url league season split playoffs date game patch ... opp_csat15 golddiffat15 xpdiffat15 csdiffat15 killsat15 assistsat15 deathsat15 opp_killsat15 opp_assistsat15 opp_deathsat15
0 ESPORTSTMNT01_2690210 True NaN LCK CL True Spring False 2022-01-10 07:44:08 1 12.01 ... 510.0 107.0 -1617.0 -23.0 5.0 10.0 6.0 6.0 18.0 5.0
1 ESPORTSTMNT01_2690210 True NaN LCK CL True Spring False 2022-01-10 07:44:08 1 12.01 ... 487.0 -107.0 1617.0 23.0 6.0 18.0 5.0 5.0 10.0 6.0
2 ESPORTSTMNT01_2690219 True NaN LCK CL True Spring False 2022-01-10 08:38:24 1 12.01 ... 555.0 -1763.0 -906.0 -22.0 1.0 1.0 3.0 3.0 3.0 1.0
3 ESPORTSTMNT01_2690219 True NaN LCK CL True Spring False 2022-01-10 08:38:24 1 12.01 ... 533.0 1763.0 906.0 22.0 3.0 3.0 1.0 1.0 1.0 3.0
4 8401-8401_game_1 False https://lpl.qq.com/es/stats.shtml?bmid=8401 LPL True Spring False 2022-01-10 09:24:26 1 12.01 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

5 rows × 112 columns

EDA¶

If we want to tackle the question "What game objectives in league of legends are more likely to be taken by winning teams?" then there are a few objectives to look at:

  • Kills
  • Towers
  • Baron
  • Hearlds
  • Dragon and Dragon Types
  • CS

Univariate Analysis¶

For univariate analysis we can look at kills, towers, and cs amounts

Also worth noting I looked at many diffrent histograms via the following method:

for col in lol_team_data.columns:
    if lol_team_data[col].dtype in [int, float]:
        display(lol_team_data[col].hist())

But this proved to create a lot of lag in the notebook so I'll limit us to just focus on columns of interest for now.

In [60]:
lol_team_data["kills"].hist()
In [61]:
lol_team_data["towers"].hist()
In [62]:
lol_team_data.columns.values
Out[62]:
array(['gameid', 'isdatacomplete', 'url', 'league', 'season', 'split',
       'playoffs', 'date', 'game', 'patch', 'onblueside', 'teamname',
       'teamid', 'ban1', 'ban2', 'ban3', 'ban4', 'ban5', 'gamelength',
       'result', 'kills', 'deaths', 'assists', 'teamkills', 'teamdeaths',
       'doublekills', 'triplekills', 'quadrakills', 'pentakills',
       'firstblood', 'team kpm', 'ckpm', 'firstdragon', 'dragons',
       'opp_dragons', 'elementaldrakes', 'opp_elementaldrakes',
       'infernals', 'mountains', 'clouds', 'oceans', 'chemtechs',
       'hextechs', 'dragons (type unknown)', 'elders', 'opp_elders',
       'firstherald', 'heralds', 'opp_heralds', 'firstbaron', 'barons',
       'opp_barons', 'firsttower', 'towers', 'opp_towers',
       'firstmidtower', 'firsttothreetowers', 'turretplates',
       'opp_turretplates', 'inhibitors', 'opp_inhibitors',
       'damagetochampions', 'dpm', 'damagetakenperminute',
       'damagemitigatedperminute', 'wardsplaced', 'wpm', 'wardskilled',
       'wcpm', 'controlwardsbought', 'visionscore', 'vspm', 'totalgold',
       'earnedgold', 'earned gpm', 'goldspent', 'gspd', 'minionkills',
       'monsterkills', 'monsterkillsownjungle', 'monsterkillsenemyjungle',
       'cspm', 'goldat10', 'xpat10', 'csat10', 'opp_goldat10',
       'opp_xpat10', 'opp_csat10', 'golddiffat10', 'xpdiffat10',
       'csdiffat10', 'killsat10', 'assistsat10', 'deathsat10',
       'opp_killsat10', 'opp_assistsat10', 'opp_deathsat10', 'goldat15',
       'xpat15', 'csat15', 'opp_goldat15', 'opp_xpat15', 'opp_csat15',
       'golddiffat15', 'xpdiffat15', 'csdiffat15', 'killsat15',
       'assistsat15', 'deathsat15', 'opp_killsat15', 'opp_assistsat15',
       'opp_deathsat15'], dtype=object)
In [63]:
lol_team_data["csat10"].hist()
In [112]:
fig = lol_team_data["csat15"].hist()
fig.write_html('../../../LOLMatchAnaysis/assets/csat15.html', include_plotlyjs='cdn')
fig.show()
In [65]:
 

Bivaritate Analysis¶

In [66]:
def compute_frists_victory(df, col):
    print(col)
    df = df[["teamid","result", col]].groupby("teamid").mean()
    fig = px.scatter(df, x="result", y=col)
    display(fig)
    return fig
    
for col in lol_team_data.columns[lol_team_data.columns.str.contains("first")]:
    compute_frists_victory(lol_team_data, col)
firstblood
firstdragon
firstherald
firstbaron
firsttower
firstmidtower
firsttothreetowers
In [67]:
fig = compute_frists_victory(lol_team_data, "firstbaron")
fig.write_html('../../../LOLMatchAnaysis/assets/firstbaron.html', include_plotlyjs='cdn')
firstbaron
In [68]:
cols = ["csat10", "csat15", "goldat10", "goldat15", "killsat10", "killsat15"]
for col in cols:
    compute_frists_victory(lol_team_data, col)
csat10
csat15
goldat10
goldat15
killsat10
killsat15

Interesting Aggreagtes¶

In [69]:
lol_team_data[["patch", "result", "teamid"]].pivot_table(
    index="teamid",
    columns="patch",
    aggfunc="mean")
Out[69]:
result
patch 12.01 12.02 12.03 12.04 12.05 12.06 12.07 12.08 12.09 12.10 ... 12.13 12.14 12.15 12.16 12.17 12.18 12.19 12.20 12.21 12.23
teamid
oe:team:01a3132448697cecc30364f52173670 NaN NaN NaN NaN NaN NaN NaN NaN 0.6 0.000000 ... NaN NaN NaN NaN NaN 0.666667 0.8 0.5 0.75 NaN
oe:team:01a959b2a20ca77057e580ec051aa3e 0.750 1.000000 0.75 0.600000 0.166667 NaN NaN NaN NaN 0.500000 ... 0.555556 NaN 0.5 0.727273 NaN 0.600000 NaN NaN NaN NaN
oe:team:01c9a45038d103935dc69490914f530 NaN 0.636364 NaN 0.428571 NaN NaN NaN NaN NaN NaN ... 0.333333 NaN NaN NaN NaN NaN NaN NaN NaN NaN
oe:team:023e1c0f9c1c213e48998e61fbe066c 0.200 NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
oe:team:03a6df9b82af1a8fbb6e86aae9524ee NaN NaN 0.00 NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
oe:team:fd27f7adaecaeac4f8736159d57c0ce NaN 0.545455 NaN 0.392857 NaN NaN NaN NaN NaN NaN ... 0.600000 0.571429 NaN NaN NaN NaN NaN NaN NaN NaN
oe:team:fe409cbd7c72eb621d9c4e7eac75936 0.750 0.750000 0.70 0.375000 0.562500 NaN NaN NaN NaN 0.666667 ... 0.200000 0.500000 0.6 NaN NaN NaN NaN NaN NaN NaN
oe:team:fe59c993d0bda004e54eaecdd957f54 0.000 0.250000 0.25 0.000000 NaN 0.25 NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
oe:team:ff0118d68f738d57ce78b30839e4f16 0.375 0.250000 0.50 0.714286 0.500000 NaN NaN NaN NaN 1.000000 ... 0.875000 0.444444 NaN NaN NaN NaN NaN NaN NaN NaN
oe:team:ff07fcf769a41fa17ded4746368d6c7 NaN NaN NaN NaN NaN NaN 0.571429 0.7 0.6 NaN ... NaN NaN NaN NaN NaN 0.703704 NaN NaN 0.25 NaN

594 rows × 22 columns

In [70]:
col = lol_team_data.columns.str.contains("first") | lol_team_data.columns.isin(["teamid","result"])
lol_team_data.loc[:,col].groupby("result").mean()
Out[70]:
firstblood firstdragon firstherald firstbaron firsttower firstmidtower firsttothreetowers
result
False 0.390738 0.507638 0.502653 0.267969 0.416546 0.378839 0.335665
True 0.607849 0.638491 0.643397 0.833601 0.729773 0.767653 0.810520
In [71]:
#Trying to do prop of all result X that got firstblood/dragon etc...
#Not excatly disjoint categories though so could be problematic...
result_counts = lol_team_data.loc[:,col].groupby("result").sum()
result_counts.loc[False] = result_counts.loc[False]/result_counts.sum(axis=1).loc[False]
result_counts.loc[True] = result_counts.loc[True]/result_counts.sum(axis=1).loc[True]
In [72]:
result_counts
Out[72]:
firstblood firstdragon firstherald firstbaron firsttower firstmidtower firsttothreetowers
result
False 0.139547 0.181296 0.179516 0.095702 0.148764 0.135297 0.119878
True 0.120814 0.126904 0.127879 0.165684 0.145047 0.152576 0.161096

Missingness Dependency¶

In [73]:
#https://dsc80.com/resources/lectures/lec10/lec10.html
def tvd_of_groups(df, groups, cats):
    '''groups: the binary column (e.g. married vs. unmarried).
       cats: the categorical column (e.g. employment status).
    '''
    cnts = df.pivot_table(index=cats, columns=groups, aggfunc='size')
    # Normalize each column.
    distr = (cnts / cnts.sum()).fillna(0)
    # Compute and return the TVD.
    return distr, distr.diff(axis=1).iloc[:, -1].abs().sum() / 2 


def permutation_test(df,shuffle_cat = "league", col_test="url",  N = 1000):
    tvds = []
    distr, tvd_observed = tvd_of_groups(df, col_test, shuffle_cat)
    shuffled_df = df.copy()
    for _ in range(N):
        # Shuffle leagues
        shuffled_df[shuffle_cat] = np.random.permutation(shuffled_df[shuffle_cat])

        # Compute and store the TVD.
        distr, tvd = tvd_of_groups(shuffled_df,col_test, shuffle_cat)
        tvds.append(tvd)
    return tvds,tvd_observed, (np.array(tvds) >= tvd_observed).mean()
In [74]:
null_percent = lol_team_data.isnull().mean()#.sort_values(ascending=False)
null_col = lol_team_data.loc[:, (null_percent > 0)].columns
null_col
Out[74]:
Index(['url', 'split', 'patch', 'teamname', 'teamid', 'ban1', 'ban2', 'ban3',
       'ban4', 'ban5', 'doublekills', 'triplekills', 'quadrakills',
       'pentakills', 'elementaldrakes', 'opp_elementaldrakes', 'infernals',
       'mountains', 'clouds', 'oceans', 'chemtechs', 'hextechs',
       'dragons (type unknown)', 'elders', 'opp_elders', 'heralds',
       'opp_heralds', 'turretplates', 'opp_turretplates', 'inhibitors',
       'opp_inhibitors', 'damagetochampions', 'dpm', 'damagetakenperminute',
       'damagemitigatedperminute', 'wardsplaced', 'wpm', 'wardskilled', 'wcpm',
       'controlwardsbought', 'visionscore', 'vspm', 'earnedgold', 'earned gpm',
       'goldspent', 'gspd', 'minionkills', 'monsterkills',
       'monsterkillsownjungle', 'monsterkillsenemyjungle', 'cspm', 'goldat10',
       'xpat10', 'csat10', 'opp_goldat10', 'opp_xpat10', 'opp_csat10',
       'golddiffat10', 'xpdiffat10', 'csdiffat10', 'killsat10', 'assistsat10',
       'deathsat10', 'opp_killsat10', 'opp_assistsat10', 'opp_deathsat10',
       'goldat15', 'xpat15', 'csat15', 'opp_goldat15', 'opp_xpat15',
       'opp_csat15', 'golddiffat15', 'xpdiffat15', 'csdiffat15', 'killsat15',
       'assistsat15', 'deathsat15', 'opp_killsat15', 'opp_assistsat15',
       'opp_deathsat15'],
      dtype='object')
In [75]:
null_team_data = lol_team_data[null_col].isnull()
null_team_data["playoffs"] = lol_team_data["playoffs"]
null_team_data["league"] = lol_team_data["league"]
null_team_data = null_team_data[np.append(["playoffs", "league"], null_col)]
null_team_data
Out[75]:
playoffs league url split patch teamname teamid ban1 ban2 ban3 ... opp_csat15 golddiffat15 xpdiffat15 csdiffat15 killsat15 assistsat15 deathsat15 opp_killsat15 opp_assistsat15 opp_deathsat15
0 False LCK CL True False False False False False False False ... False False False False False False False False False False
1 False LCK CL True False False False False False False False ... False False False False False False False False False False
2 False LCK CL True False False False False False False False ... False False False False False False False False False False
3 False LCK CL True False False False False False False False ... False False False False False False False False False False
4 False LPL False False False False False False False False ... True True True True True True True True True True
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
24867 False DC False True False False False False False False ... True True True True True True True True True True
24868 False DC False True False False False False False False ... True True True True True True True True True True
24869 False DC False True False False False False False False ... True True True True True True True True True True
24870 False DC False True False False False False False False ... True True True True True True True True True True
24871 False DC False True False False False False False False ... True True True True True True True True True True

24872 rows × 83 columns

In [88]:
tvds, tvd_observed, p_value = permutation_test(null_team_data,shuffle_cat = "league", col_test="csat10",  N = 1000)
p_value
Out[88]:
0.0
In [89]:
tvds
Out[89]:
[0.044664849484963576,
 0.050068653056393055,
 0.05301076416337899,
 0.05008496388549425,
 0.05032356801406024,
 0.0468589407913279,
 0.04260207329796628,
 0.04423212059988847,
 0.041626478596075676,
 0.05466877288661753,
 0.0429643808256521,
 0.04063483196713311,
 0.03360993910468461,
 0.045339237542785495,
 0.05042060450210987,
 0.04033844090118003,
 0.03521306059348738,
 0.039589903296459984,
 0.04303733942312378,
 0.047770845589109094,
 0.037734973674580743,
 0.046266676463520215,
 0.04344775095155563,
 0.04837434626585316,
 0.046640634583421166,
 0.04177467412905221,
 0.03770903168924836,
 0.05329032659613242,
 0.04697316837544608,
 0.04572929937014828,
 0.03764653273456538,
 0.043343983010226156,
 0.04802353398915293,
 0.05728663506715375,
 0.04041165840070094,
 0.03567722018733842,
 0.039045691188988506,
 0.040529821295967355,
 0.03685537985254286,
 0.04295200530769913,
 0.045786257820977824,
 0.03972624111558199,
 0.05227361824882486,
 0.040179009019267124,
 0.04696369256044443,
 0.04007037371941222,
 0.052870283911469376,
 0.04547174361157899,
 0.037957784778143995,
 0.03646521446436039,
 0.049455728345057196,
 0.048457039580375706,
 0.04079794025814502,
 0.0383991609916632,
 0.046949970751835504,
 0.04397259718574508,
 0.04392449318499904,
 0.045124141720289175,
 0.04799562434824645,
 0.04225809603536561,
 0.04759991845621058,
 0.06248077975912064,
 0.030211539026144082,
 0.04980260531060919,
 0.04875783198116561,
 0.042894270150721905,
 0.03971184616164508,
 0.04989467087931369,
 0.04335936179195014,
 0.03547346427459813,
 0.04589468599919337,
 0.051385480659162555,
 0.04697223632806888,
 0.045800549214095064,
 0.044849032402782416,
 0.05817979535657104,
 0.04685490191935999,
 0.04349766726664628,
 0.05090879020612901,
 0.04685676601411441,
 0.039945531151275804,
 0.04453586448403955,
 0.038298085631645655,
 0.057202232999106324,
 0.05703788197825813,
 0.05512992921669755,
 0.03315520354542538,
 0.05392484373837368,
 0.04109987182795151,
 0.04404861082739761,
 0.04856469105244356,
 0.05057532436672689,
 0.04835032015568506,
 0.041546684984504444,
 0.04867032308852747,
 0.052660935714465826,
 0.04706626955234748,
 0.04267813872002865,
 0.04014359121893311,
 0.04283648321333482,
 0.05447946370822401,
 0.038855657084857165,
 0.03984730371379973,
 0.039853310241341755,
 0.0460658720341411,
 0.03649208849706998,
 0.042326135493902003,
 0.04366217362872401,
 0.04740926298716109,
 0.041620834531402556,
 0.03849334955717135,
 0.050256305261671526,
 0.04362649692634077,
 0.03833355521238953,
 0.052704327697915984,
 0.045840782592544656,
 0.040005233963827144,
 0.04205599709574037,
 0.039814785616417034,
 0.047361469668874126,
 0.05376158010613223,
 0.051353842828747207,
 0.053812480249009934,
 0.05563566847965415,
 0.051938288314668304,
 0.04869253688435099,
 0.048153399257044316,
 0.045649609319396746,
 0.048889716685040954,
 0.0500100894128583,
 0.05352685950830461,
 0.04550643648617518,
 0.04271241735134608,
 0.04745286209225064,
 0.0565810752026051,
 0.04515075685094952,
 0.045683370146615714,
 0.04134101319659991,
 0.05010831685033437,
 0.04222350672158911,
 0.04518265358341408,
 0.04235202569882453,
 0.037037180871508826,
 0.04660506144185761,
 0.045145061005866585,
 0.042308892617423606,
 0.05374977417268756,
 0.04573996613457634,
 0.05130304624668923,
 0.06292723045280468,
 0.046109108676361726,
 0.039076811215305374,
 0.05360106083561257,
 0.04867891863656174,
 0.05001216062925212,
 0.060848816582034185,
 0.0303113198759155,
 0.04890690778110951,
 0.04237600002858279,
 0.04236854364956509,
 0.04280572564988686,
 0.04848986836021746,
 0.043526560735339816,
 0.0512317446223326,
 0.036920053584439325,
 0.04469239666300113,
 0.04968811882444178,
 0.04355353832886909,
 0.043084459596082765,
 0.044988373485675456,
 0.0509539427235139,
 0.05556167427398558,
 0.05795480947579429,
 0.03836141307288615,
 0.05054658623926288,
 0.04754311534661056,
 0.03873449092581974,
 0.05015812960460531,
 0.048898312233075225,
 0.04576430292720353,
 0.0533155954361368,
 0.04847914981537955,
 0.0405491871692494,
 0.05464945879374532,
 0.05297607128878281,
 0.03710444362389756,
 0.051912346329335925,
 0.04532779407220975,
 0.04870014860459822,
 0.05444477083362784,
 0.05374594242235903,
 0.048339808732486514,
 0.04692962105076638,
 0.04865509964803302,
 0.04208017854713801,
 0.04794089245504024,
 0.051840992924569465,
 0.05089921083030768,
 0.04775070300967935,
 0.036812039649502554,
 0.04665596158473529,
 0.04438580485630858,
 0.04278832743217893,
 0.043709138460453455,
 0.05446884872420578,
 0.04839262475052846,
 0.05469756279449138,
 0.03910347812637558,
 0.056623483358268195,
 0.04725392175762595,
 0.03956986427784995,
 0.04774676769853114,
 0.051048338410661406,
 0.04923835418452767,
 0.0493404651527421,
 0.04604096565700562,
 0.05093959954998682,
 0.052066910852723414,
 0.04355731829878778,
 0.04287127964875069,
 0.03611150248470885,
 0.043756206853002605,
 0.04527000713482268,
 0.0458033453562267,
 0.04962867491393966,
 0.05205639942952486,
 0.05528936109861046,
 0.05126628215569923,
 0.04999098244162548,
 0.046022635391920474,
 0.05638322225658715,
 0.04003490413866835,
 0.043532411921652296,
 0.050602250179846306,
 0.055758388050986936,
 0.04710458705563282,
 0.042414628214327205,
 0.0470259326130782,
 0.05163904932617377,
 0.04678639643713498,
 0.045612275643898456,
 0.05433618731418276,
 0.0470635251906257,
 0.0490356338799843,
 0.044296483649325875,
 0.05007175988098375,
 0.04861295039441914,
 0.05583450525345915,
 0.041481441668099694,
 0.05040698625432062,
 0.050655117978298095,
 0.04421280650701627,
 0.050180291620019,
 0.039806034727153224,
 0.048208182930660384,
 0.04522506173907716,
 0.048042899862434985,
 0.04171673185043559,
 0.043164201427244156,
 0.037540952478891325,
 0.04829740057682341,
 0.03654894338707984,
 0.05529039670680736,
 0.04174370944396487,
 0.0469864241603664,
 0.04112571025246419,
 0.03583670384966117,
 0.05180573046546498,
 0.04500478787559633,
 0.04891840303209509,
 0.049223182524443077,
 0.040956491873090556,
 0.044586712846507386,
 0.048752084355672805,
 0.0425375031268895,
 0.049627742866562456,
 0.046078299332503916,
 0.05029094635585786,
 0.044590492816426075,
 0.0415860380959867,
 0.048264053992883194,
 0.05090112670547193,
 0.04663581900530557,
 0.04262206053616647,
 0.04983734996561522,
 0.04496248328075292,
 0.047745628529514555,
 0.04326517322644201,
 0.04650419320347946,
 0.04293854240113942,
 0.05264550515233201,
 0.05441209739501561,
 0.04841571881331934,
 0.05281275587613152,
 0.049329643047084495,
 0.044326257384986786,
 0.05420735765448827,
 0.05265037251085744,
 0.04574483349310179,
 0.054643866509482046,
 0.0429586332001593,
 0.0484417643594714,
 0.05228604554718767,
 0.04775153149623687,
 0.05728471919198949,
 0.045969819373878534,
 0.04147667787039394,
 0.053220319482021924,
 0.041598620735579045,
 0.05627287820320734,
 0.05234662862670638,
 0.04140936333759537,
 0.048772175154692676,
 0.03769334222506532,
 0.03949162407857408,
 0.05090589050317769,
 0.051566349630751324,
 0.038928719243148516,
 0.05954037740565958,
 0.04384935981031386,
 0.04101624646605175,
 0.042573179829272736,
 0.05413507220234458,
 0.0369249727233746,
 0.04432713765195414,
 0.04498179737362511,
 0.0473950233744537,
 0.044014953560998334,
 0.047955339189387006,
 0.050903042580636194,
 0.053311763685808276,
 0.04658093177086982,
 0.04144980383768436,
 0.0482284290709098,
 0.04827270132132733,
 0.037033556242819676,
 0.049590046728195246,
 0.0468028626074657,
 0.04517312598800258,
 0.03938811503929382,
 0.05453409204061055,
 0.04759784723981677,
 0.05065713741428207,
 0.03656898240568988,
 0.05259460500945432,
 0.03942575939725119,
 0.047127940020472936,
 0.05024087469953771,
 0.044663606755127275,
 0.04039156760168107,
 0.03691021530656875,
 0.0474662732184005,
 0.04763621652351195,
 0.04568538958259966,
 0.03639318791426595,
 0.0313109406879742,
 0.03812027170423776,
 0.04323814385250287,
 0.04152737089163225,
 0.04905965999015241,
 0.051749030916684646,
 0.04657621975357392,
 0.04201270867310991,
 0.049463288284894574,
 0.045895618046570566,
 0.049284542310109467,
 0.04665668651047314,
 0.04316326937986694,
 0.04647146798445739,
 0.03912082456367366,
 0.04497863876862457,
 0.0516470235092899,
 0.041956060904739426,
 0.04228968208537107,
 0.043826317527932826,
 0.05193927214245536,
 0.04323829919373241,
 0.0616830507650478,
 0.05201611427066542,
 0.048906027514142136,
 0.05663518573089317,
 0.0477150263072961,
 0.046016784205607994,
 0.04133138204036872,
 0.044233829353413356,
 0.0427807157119317,
 0.050922408453918266,
 0.04953169020629988,
 0.046878876249118254,
 0.04494503328263513,
 0.04175836329995102,
 0.04893264264480249,
 0.04841882563791007,
 0.04319894608225018,
 0.04884912084372243,
 0.05747894750931827,
 0.04063260540950977,
 0.04735768969895544,
 0.045153656553900835,
 0.046842215718947956,
 0.03733590205590494,
 0.05185663060834267,
 0.0497517051677315,
 0.0402087309745182,
 0.056415895695199385,
 0.050695506697977254,
 0.051527721445006884,
 0.035895629956064844,
 0.04181490750750181,
 0.049568920320978475,
 0.05542497399199465,
 0.05103958752139762,
 0.05093203961014943,
 0.04888003374839991,
 0.047887921095768754,
 0.04052619666727818,
 0.04677039629049287,
 0.04617626786793076,
 0.03914117426474277,
 0.057080134792691695,
 0.04971877282707005,
 0.04238200655612481,
 0.05016605200731159,
 0.04365425122601771,
 0.046424451372318085,
 0.042759796426354295,
 0.053977607976005794,
 0.0457890021826996,
 0.048077592737031175,
 0.043675532974464026,
 0.04776111087205821,
 0.04872122323140515,
 0.039878371959706754,
 0.04734707471493719,
 0.03466030471839146,
 0.04348632735689021,
 0.0503006292924989,
 0.03857107195234878,
 0.03849117477995784,
 0.03411241620182098,
 0.044618402457332555,
 0.04811192314875844,
 0.04484411326384713,
 0.053846862441147045,
 0.05079725520332277,
 0.03779928494360829,
 0.05465225493587696,
 0.04017030991041315,
 0.04199727811097609,
 0.04229630997783126,
 0.0514240570644971,
 0.045247896899818826,
 0.05865053106247238,
 0.049127958350738035,
 0.04785737065396016,
 0.05139614742359064,
 0.049695057399361024,
 0.04728928777755012,
 0.045454604295920284,
 0.04293165560663003,
 0.04891239650455308,
 0.033873138927927,
 0.0522899808583359,
 0.036917102101078146,
 0.05003722234761711,
 0.034215407437002805,
 0.04097487391858556,
 0.03980023532125058,
 0.041025877622282936,
 0.04998036745760725,
 0.041837017742505644,
 0.04731911329362086,
 0.05246665561672721,
 0.04320277783257871,
 0.04174655736650636,
 0.04903382156563972,
 0.05659583261941093,
 0.04409573100035661,
 0.04091522288644407,
 0.048300300279774736,
 0.04192654607112775,
 0.04119768502214881,
 0.04877326254329943,
 0.05183426147128958,
 0.04463181358348243,
 0.04809084852195149,
 0.047090451003745114,
 0.043912997934013445,
 0.04406766601822059,
 0.04991988793890822,
 0.04436747459122345,
 0.04971442327264307,
 0.043507401983697146,
 0.049169382678614065,
 0.04302102859402259,
 0.04899622898809223,
 0.05546846953626449,
 0.047931261298809064,
 0.03685465492680502,
 0.05432955942172259,
 0.040096522826383964,
 0.042341566056035826,
 0.052738606329233426,
 0.04934522895044786,
 0.04374973430177198,
 0.04716527369597122,
 0.0495083890218696,
 0.04497863876862457,
 0.04763647542556119,
 0.048299523573627046,
 0.04225385004175831,
 0.04348710406303787,
 0.040172174005167594,
 0.04294144210409074,
 0.04645329306060178,
 0.05994322899425408,
 0.04611868805218304,
 0.05086265386095706,
 0.047538403329314666,
 0.04468297262840934,
 0.03848941424602312,
 0.04108159334327621,
 0.04975253365428901,
 0.05371616868669813,
 0.04130549183544622,
 0.05718281534541443,
 0.04198982173195841,
 0.05387870739320173,
 0.05106180131722114,
 0.0458948413404229,
 0.04434551969744914,
 0.044770119058178556,
 0.0433111542303844,
 0.05114226807412034,
 0.04570138972924179,
 0.05574984428336248,
 0.05416204979587385,
 0.05166131490240713,
 0.050175579602723105,
 0.042943254418435314,
 0.05246194359943131,
 0.04669723057138181,
 0.052535057538132514,
 0.046043761799137266,
 0.0380581352124237,
 0.041759295347328244,
 0.04572080738293368,
 0.04408801571928969,
 0.04426163543350016,
 0.03797238685372029,
 0.05475037881253332,
 0.043272784946689215,
 0.05438719101788014,
 0.05322901859087589,
 0.05304664798740161,
 0.05037736785988925,
 0.046593462630052325,
 0.040359981551675576,
 0.04366968178815153,
 0.04970256555878855,
 0.053882383802300746,
 0.047078800411529995,
 0.043795559964484865,
 0.052060179399443574,
 0.04759106400612707,
 0.04785348712322178,
 0.04331892129186114,
 0.04542291468509511,
 0.04996602428408017,
 0.039022804247836995,
 0.054340174405740835,
 0.04148625724621528,
 0.049171143212548785,
 0.04287102074670146,
 0.049446148969235854,
 0.04073347364788793,
 0.050774264701351546,
 0.03710361513734004,
 0.04609098553291595,
 0.04625052097564855,
 0.04549794449896059,
 0.04010025101589281,
 0.04462326981585799,
 0.04775251532402395,
 0.04661443369603958,
 0.04206174472123317,
 0.05437652425345206,
 0.04741511417347359,
 0.0459889781255212,
 0.05579805184492824,
 0.05385172979967246,
 0.03523232290594974,
 0.03548961976246979,
 0.04538449362099008,
 0.045330693775161086,
 0.042803706213902906,
 0.04772268980795319,
 0.053115515932495534,
 0.03772135542679149,
 0.051646039681502845,
 0.03895859653962913,
 0.04840510382930111,
 0.04976703216904564,
 0.04808712033244266,
 0.04526814304006825,
 0.04556386096069334,
 0.04854346108440708,
 0.045166290973903046,
 0.03485712205621251,
 0.050505317252616366,
 0.0471211050063734,
 0.04783608890551385,
 0.04248867420040563,
 0.053417395721892184,
 0.04542773026321069,
 0.05739920567815691,
 0.050247606152817564,
 0.039571521250965,
 0.04247127598269768,
 0.058226811968710344,
 0.0454842744707615,
 0.04046918643603879,
 0.054181519229975585,
 0.04146186867317826,
 0.039095762845308676,
 0.0402242650974717,
 0.048705015963123655,
 0.04226865923897398,
 0.041870571448085245,
 0.03949177941980361,
 0.04952211083047854,
 0.054270011950400786,
 0.05395057860206666,
 0.04282612713136581,
 0.041987750515564595,
 0.0385230715124224,
 0.04071436667665511,
 0.048655047867623175,
 0.03874992148795357,
 0.056019930901114276,
 0.04870398035492675,
 0.04583519030828139,
 0.05190566665646592,
 0.04902517423719561,
 0.058839788460456066,
 0.04056617114367857,
 0.04302972770287655,
 0.047663245897451065,
 0.036777709237775284,
 0.04261724495805089,
 0.0567600282990296,
 0.044572214331750765,
 0.046024447706265056,
 0.0444866213142769,
 0.048452275782669946,
 0.04980840471651183,
 0.055769054815415,
 0.04322462916553333,
 0.04006928633080546,
 0.049735446119040155,
 0.03166175296467442,
 0.04452131418887308,
 0.04151116362335075,
 0.03619165855914899,
 0.04530345727958257,
 0.04112581381328388,
 0.050117119520008024,
 0.04972581496280898,
 0.05121848883741227,
 0.05679270173764182,
 0.040199928304844534,
 0.05107510888255131,
 0.0501764080892806,
 0.04331415749415542,
 0.049697905321902505,
 0.04895785970439703,
 0.058437195773910766,
 0.04325942560094919,
 0.04759013195874987,
 0.04333341980661777,
 0.04855490455498285,
 0.04716252933424944,
 0.039825607722074656,
 0.05008123569598541,
 0.05271861909103322,
 0.04695685754634489,
 0.04067988092369831,
 0.04361686577010957,
 0.057278039519119486,
 0.043808194384487034,
 0.04974699315043561,
 0.03635777011393192,
 0.043737048101359956,
 0.046419428672563094,
 0.04190231283932026,
 0.045843992977955064,
 0.05219563695159821,
 0.04952195548924901,
 0.045392053560827456,
 0.045805261231390976,
 0.046578964115295704,
 0.05031186564143526,
 0.04590053718550584,
 0.049797945073723135,
 0.05533285664288029,
 0.04566871629062956,
 0.04982673498159698,
 0.04996783659842475,
 0.04733625260927958,
 0.04177265469306826,
 0.04330856520989215,
 0.04536026038918261,
 0.04086069811487722,
 0.049666112150257645,
 0.04582374683770564,
 0.056178586076879526,
 0.04737586462281104,
 0.044012830564194694,
 0.05277148688948502,
 0.050719481027735505,
 0.04266633278658398,
 0.04793711248512156,
 0.041765871459378566,
 0.04269921334683559,
 0.0502283438403552,
 0.048845392654213574,
 0.043934901047377885,
 0.042781906661358136,
 0.05767214021845017,
 0.0386747881132684,
 0.044703063427429204,
 0.048464703081032776,
 0.04690901244764807,
 0.04430223127481867,
 0.04875788376157544,
 0.045662243739398936,
 0.05013912619419217,
 0.04034144416495104,
 0.047143991947524916,
 0.03904279148603717,
 0.04245610432261308,
 0.04409557565912707,
 0.05423034815645947,
 0.049858321031602454,
 0.04264241023723557,
 0.042097214301977035,
 0.04462321803544815,
 0.043325652745141024,
 0.049644933962631005,
 0.0426164682519032,
 0.04568709833612454,
 0.04852150619063279,
 0.04340648196490915,
 0.04231847199324493,
 0.0459362138878891,
 0.05436016164394103,
 0.041308391538397535,
 0.047437586871346346,
 0.043353717727277044,
 0.05284729340949817,
 0.054166865373989445,
 0.06252955690519467,
 0.046401357309527186,
 0.0460465579412689,
 0.04448366983091573,
 0.05379979404859789,
 0.047076884536365715,
 0.04747854517553379,
 0.043615933722732356,
 0.04087498950799446,
 0.045090121991020964,
 0.05069162316723887,
 0.040238711831818465,
 0.03351663080614384,
 0.044119653549705026,
 0.03351937516786562,
 0.047768049446977434,
 0.04758262379932232,
 0.05876579425478748,
 0.039503430012018746,
 0.04474723211702703,
 0.039148527082940754,
 0.052725454105132755,
 0.04560150531865069,
 0.04722130009942357,
 0.05154807114607601,
 0.04092780552603641,
 0.04483256623245168,
 0.04725951404188922,
 0.03904978184136626,
 0.04563899433537851,
 0.05186709025113136,
 0.05055906531803554,
 0.046829736640175285,
 0.047386479606829277,
 0.04705311732824685,
 0.04932881456052697,
 0.04207727884418669,
 0.04931426426536052,
 0.03764658451497524,
 0.04340658552572884,
 0.046221679287364856,
 0.049670668826323996,
 0.050104329758776295,
 0.04353795242550572,
 0.04886657084184021,
 0.05046363402269109,
 0.04039234430782874,
 0.04341212602958225,
 0.05347021173993413,
 0.06384529711935742,
 0.039975201326117024,
 0.04581499594844184,
 0.041471758731458655,
 0.03898635083930607,
 0.04754487588054529,
 0.03711692270267021,
 0.05067639972674441,
 0.03865003707736246,
 0.042583587691651596,
 0.032773633705277194,
 0.0449270654804189,
 0.054134347276606765,
 0.041654232895752624,
 0.052896433018441116,
 0.05295903553394379,
 0.05743384677234325,
 0.04286066466473246,
 0.048193632635493915,
 0.048829754970440384,
 0.03948401235832687,
 0.05844874280530622,
 0.0448241778060568,
 0.04592663451206777,
 0.050608153146568635,
 0.050300681072908734,
 0.044383888981144315,
 0.04129492863183783,
 0.04759577602342298,
 0.038536637979801815,
 0.04366885330159401,
 0.042137758362885705,
 0.04907990613040182,
 0.04379183177497601,
 0.04946339184571427,
 0.03858453485890849,
 0.052256168250707086,
 0.040994964717605435,
 0.05292418731811806,
 0.04183215038398022,
 0.03823558667696268,
 0.04770834663442611,
 0.04663488695792836,
 0.04481263077466135,
 0.04390637004155326,
 0.049004928096946176,
 0.05685613273970201,
 0.04525970283326351,
 0.04950481617359031,
 0.04426484581891054,
 0.04384589052285424,
 0.052780185998339,
 0.04421570620996759,
 0.03811954677849992,
 0.04981700026454612,
 0.045038289800766074,
 0.04790842613806738,
 0.049942982001699124,
 0.041235381160516005,
 0.04360050316059854,
 0.044409727405657004,
 0.049785465994950484,
 0.05534341984648869,
 0.0482583063673904,
 0.044411798622050795,
 0.044554867894452684,
 0.0404780408861223,
 0.04760452691268679,
 0.04230604469488211,
 0.04504424454789825,
 0.05196785492868983,
 0.05306368374224064,
 0.047442350669052086,
 0.040221210053290844,
 0.04648943578667361,
 0.04604572945471137,
 0.04749045466979814,
 0.038697985736878986,
 0.04922406279141042,
 0.04069717558058655,
 0.0474144410281456,
 0.04376309364751201,
 0.05356926766396772,
 0.04857825751982297,
 0.04020774714673112,
 0.047620061035640295,
 0.050081287476395245,
 0.040008858592516294,
 0.04249535387327562,
 0.05036385317291969,
 0.04966326422771616,
 0.051378645645063,
 0.04840997118782655,
 0.0468212446529607,
 0.04550260473584664,
 0.04873194177624307,
 0.039322768162069366,
 0.04637334410780103,
 0.041017230293838816,
 0.0578951584436528,
 0.04072865806977233,
 0.04594677709149749,
 0.043000834234183015,
 0.04230423238053756,
 0.0450567236266709,
 0.04432718943236398,
 0.044668474113652726,
 0.047987028800212175,
 0.04837243039068888,
 0.04565463201915171,
 0.05115013869641678,
 0.04169954075436704,
 0.04628013937007992,
 0.044685561648901584,
 0.04498060642419868,
 0.04736820112215395,
 0.04565085204923301,
 0.05331264395277564,
 0.04285569374538735,
 0.03931593314796983,
 0.03693139349419539,
 0.03877881495664712,
 0.04273747906971108,
 0.0558370942739514,
 0.03757264208971651,
 0.04731129445173426,
 0.03831242880517275,
 0.04366776591298725,
 0.05135953867383017,
 0.06035348518145642,
 0.0454795624534656,
 0.05174695970029084,
 0.03889972221363531,
 0.047301922197552304,
 0.04507955878741257,
 0.05076561737290744,
 0.047253869977216104,
 0.054127460482097364,
 0.042259856569300334,
 0.04557861837749917,
 0.04185441596021358,
 0.050548398553607446,
 0.054736087419416095,
 0.040999832076130865,
 0.038970143571024574,
 0.047493043690290386,
 0.0436795200660221,
 0.05304918522748403,
 0.04338131668572443,
 0.04331788568366425,
 0.04207541474943226,
 0.04361878164527386,
 0.04701350531471536,
 0.047520953331196866,
 0.042198186101174893,
 0.056001704196848814,
 0.04535653219967374,
 0.04756330970645012,
 0.04618294754080077,
 0.04932125462068959,
 0.04575058111859459,
 0.048146667803764476,
 0.04730865365083216,
 0.045097940832907565,
 0.04712897562866984,
 0.04542477877984953,
 0.047326932135507475,
 0.051957447066310974,
 0.044021529673048655,
 0.04648296323544299,
 0.04777845730935632,
 0.0480323366588266,
 0.043182376351099755,
 0.042983539577294776,
 0.0407776941178956,
 0.04574695648990544,
 0.047497911048815816,
 0.04823583366951764,
 0.0505463791176235,
 0.052544585133544,
 0.05155376699115896,
 0.040153791959672586,
 0.04685086304739208,
 0.04793623221815418,
 0.04392754822917989,
 0.04442137799787213,
 0.04829553648206898,
 0.03598878291337609,
 0.039702318566233574,
 0.052244828340951004]
In [90]:
tvd_observed
Out[90]:
0.9923034634414514
In [98]:
#https://dsc80.com/resources/lectures/lec12/lec12.html
fig = px.histogram(pd.DataFrame(tvds), x=0, nbins=50, histnorm='probability', 
                   title='TVD betweeen missingness of cs at 10 statistic and League')
fig.add_vline(x=tvd_observed, line_color='red')
fig.add_annotation(text=f'<span style="color:red">Observed TVD = {round(tvd_observed, 2)}</span>',
                   x=tvd_observed-0.25, showarrow=False, y=0.16)
fig.update_layout(xaxis_range=[0, 1.2])
fig.write_html('../../../LOLMatchAnaysis/assets/missingness1.html', include_plotlyjs='cdn')
fig.show(0)
In [80]:
p_values = {}
p_values["league"] = {}
#p_values["playoffs"] = {}
for col in null_col:
    for key in p_values:
        print(key, col)
        tvds,obsreved, p_value = permutation_test(null_team_data, 
                         shuffle_cat = key, 
                         col_test=col,  N = 100)
        
        p_values[key][col] = p_value
p_values
league url
league split
league patch
league teamname
league teamid
league ban1
league ban2
league ban3
league ban4
league ban5
league doublekills
league triplekills
league quadrakills
league pentakills
league elementaldrakes
league opp_elementaldrakes
league infernals
league mountains
league clouds
league oceans
league chemtechs
league hextechs
league dragons (type unknown)
league elders
league opp_elders
league heralds
league opp_heralds
league turretplates
league opp_turretplates
league inhibitors
league opp_inhibitors
league damagetochampions
league dpm
league damagetakenperminute
league damagemitigatedperminute
league wardsplaced
league wpm
league wardskilled
league wcpm
league controlwardsbought
league visionscore
league vspm
league earnedgold
league earned gpm
league goldspent
league gspd
league minionkills
league monsterkills
league monsterkillsownjungle
league monsterkillsenemyjungle
league cspm
league goldat10
league xpat10
league csat10
league opp_goldat10
league opp_xpat10
league opp_csat10
league golddiffat10
league xpdiffat10
league csdiffat10
league killsat10
league assistsat10
league deathsat10
league opp_killsat10
league opp_assistsat10
league opp_deathsat10
league goldat15
league xpat15
league csat15
league opp_goldat15
league opp_xpat15
league opp_csat15
league golddiffat15
league xpdiffat15
league csdiffat15
league killsat15
league assistsat15
league deathsat15
league opp_killsat15
league opp_assistsat15
league opp_deathsat15
Out[80]:
{'league': {'url': 0.0,
  'split': 0.0,
  'patch': 0.0,
  'teamname': 0.0,
  'teamid': 0.0,
  'ban1': 0.0,
  'ban2': 0.0,
  'ban3': 0.0,
  'ban4': 0.0,
  'ban5': 0.0,
  'doublekills': 0.0,
  'triplekills': 0.0,
  'quadrakills': 0.0,
  'pentakills': 0.0,
  'elementaldrakes': 0.0,
  'opp_elementaldrakes': 0.0,
  'infernals': 0.0,
  'mountains': 0.0,
  'clouds': 0.0,
  'oceans': 0.0,
  'chemtechs': 0.0,
  'hextechs': 0.0,
  'dragons (type unknown)': 0.0,
  'elders': 0.0,
  'opp_elders': 0.0,
  'heralds': 0.0,
  'opp_heralds': 0.0,
  'turretplates': 0.0,
  'opp_turretplates': 0.0,
  'inhibitors': 0.76,
  'opp_inhibitors': 0.73,
  'damagetochampions': 0.77,
  'dpm': 0.72,
  'damagetakenperminute': 0.78,
  'damagemitigatedperminute': 0.0,
  'wardsplaced': 0.8,
  'wpm': 0.69,
  'wardskilled': 0.81,
  'wcpm': 0.73,
  'controlwardsbought': 0.74,
  'visionscore': 0.82,
  'vspm': 0.76,
  'earnedgold': 0.65,
  'earned gpm': 0.78,
  'goldspent': 0.68,
  'gspd': 0.61,
  'minionkills': 0.0,
  'monsterkills': 0.67,
  'monsterkillsownjungle': 0.0,
  'monsterkillsenemyjungle': 0.0,
  'cspm': 0.0,
  'goldat10': 0.0,
  'xpat10': 0.0,
  'csat10': 0.0,
  'opp_goldat10': 0.0,
  'opp_xpat10': 0.0,
  'opp_csat10': 0.0,
  'golddiffat10': 0.0,
  'xpdiffat10': 0.0,
  'csdiffat10': 0.0,
  'killsat10': 0.0,
  'assistsat10': 0.0,
  'deathsat10': 0.0,
  'opp_killsat10': 0.0,
  'opp_assistsat10': 0.0,
  'opp_deathsat10': 0.0,
  'goldat15': 0.0,
  'xpat15': 0.0,
  'csat15': 0.0,
  'opp_goldat15': 0.0,
  'opp_xpat15': 0.0,
  'opp_csat15': 0.0,
  'golddiffat15': 0.0,
  'xpdiffat15': 0.0,
  'csdiffat15': 0.0,
  'killsat15': 0.0,
  'assistsat15': 0.0,
  'deathsat15': 0.0,
  'opp_killsat15': 0.0,
  'opp_assistsat15': 0.0,
  'opp_deathsat15': 0.0}}
In [100]:
tvds, tvd_observed, p_value = permutation_test(null_team_data,shuffle_cat = "league", col_test="visionscore",  N = 1000)
p_value
Out[100]:
0.729
In [105]:
fig = px.histogram(pd.DataFrame(tvds), x=0, nbins=50, histnorm='probability', 
                   title='TVD betweeen missingness of visionscore at 10 statistic and League')
fig.add_vline(x=tvd_observed, line_color='red')
fig.add_annotation(text=f'<span style="color:red">Observed TVD = {round(tvd_observed, 2)}</span>',
                   x=tvd_observed-0.025, showarrow=False, y=0.08)
#fig.update_layout(xaxis_range=[0, 1.2])
fig.write_html('../../../LOLMatchAnaysis/assets/missingness2.html', include_plotlyjs='cdn')
fig.show(0)

Hypothesis Testing¶

Null Hypothesis:

  • The distrubition of Winning teams and lossing teams taking baron is from the same ditrobution
  • The distrubtion of Winning teams and lossing teams taking baron come from diffrent ditrobution

So we use a permutation test!

In [109]:
tvds, tvd_observed, p_value = permutation_test(lol_team_data,shuffle_cat = "result", col_test="firstbaron",  N = 1000)
p_value
Out[109]:
0.0
In [110]:
fig = px.histogram(pd.DataFrame(tvds), x=0, nbins=50, histnorm='probability', 
                   title='TVD betweeen firstbaron and result of win')
fig.add_vline(x=tvd_observed, line_color='red')
fig.add_annotation(text=f'<span style="color:red">Observed TVD = {round(tvd_observed, 2)}</span>',
                   x=tvd_observed-0.025, showarrow=False, y=0.08)
fig.write_html('../../../LOLMatchAnaysis/assets/hypotest.html', include_plotlyjs='cdn')
fig.show(0)
In [107]:
lol_team_data[["result", "firstbaron"]].value_counts(normalized=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[107], line 1
----> 1 lol_team_data[["result", "firstbaron"]].value_counts(normalized=True)

TypeError: value_counts() got an unexpected keyword argument 'normalized'
In [ ]:
 
In [ ]: